Note that there are some explanatory texts on larger screens.

plurals
  1. POQuery performance of combined index vs. multiple single indexes vs. fulltext index
    primarykey
    data
    text
    <p><strong>Background:</strong> I have a table with 5 million address entries which I'd like to search for different fields (customer name, contact name, zip, city, phone, ...), up to 8 fields. The data is pretty stable, maximum 50 changes a day, so almost only read access.</p> <p>The user isn't supposed to tell me in advance what he's searching for, and I also want support of combined search (AND-concatenation of search terms). For example "lincoln+lond" should search for all records containing both search terms in any of the search fields, also those entries starting with any of the terms (like "London" in this example).</p> <p><strong>Problem:</strong> Now I need to choose an indexing strategy for this search table. (As a side note: I'm trying to achieve sub-second response time, worst response time should be 2 seconds.) What's better in terms of perfomance:</p> <ol> <li>Do a combined index out of all queryable columns (would need 2 of them, as index limit of 900 bytes reached) </li> <li>Put single indexes on each of the queryable columns</li> <li>Make a fulltext index on the queryable columns and use fulltext query</li> </ol> <p>I'm discarding point 1, as it doesn't seem to have any advantage (index usage will be limited and there will be no "index seek", because not all fields fit in one single index).</p> <p><strong>Question:</strong> Now, should I use the <strong>multiple single indexes</strong> variant or should I go with the <strong>fulltext index</strong>? Is there <strong>any other way</strong> to achieve the functionality mentioned above?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload