Speed up autosuggest in large data environments
The autosuggest infrastructure was assuming the the Postgres query planner
would be able to cope with large datasets without any additional fiddling.
Unfortunately, that proved to be untrue. We also needed a few indexing
changes.
* At the suggestion of Ben Shum, ignore the identifier search class for
autosuggest.
* Added indexes to all joined columns of metabib.browse_entry_def_map.
* Switched from GIST to GIN indexing of metabib.browse_entry.index_vector
because GIN, being an inverted index, is /much/ better for prefix matching
which, in turn, is extremely important for browse and autosuggest.
* Apply some reasonable sanity-checking limits on suggest queries. This
means you can't use autosuggest as a reporting tool -- but that's OK
because it's not one.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>