Queries and the Search Component

If you choose to use complex joins in your SQL queries, Index Server has to do extra searching effort. This is because the application's SQL queries create many duplicate entries. For example, if a given library item has two authors and two subjects, the table resulting from a query would contain these entries:

  1. BookTitle AuthorName1 Subject1
  2. BookTitle AuthorName1 Subject2
  3. BookTitle AuthorName2 Subject1
  4. BookTitle AuthorName2 Subject2

If the search had a larger number of authors and subjects than two each, this matrix would become even larger and more unwieldy. To remove the duplicate entries after the search is performed, the application had to use SQL's "distinct" keyword to collapse the matrix into unique entries.

This is the approach that was first used in the CML application, and the primary problem that temporary tables were created to solve. However, a simplified search does not incur the added overhead of searching duplicate entries. It is therefore better for performance reasons to separate the search into more granular author, subject, and title searches, as has been done in the final CML application implementation.