Add additional pg_trgm indexes for quicker searches

This allows our normal keyword-based search to be index-optimized rather
than always doing full table scans. It requires the pg_trgm extension
which is shipped out of the box with any sane install of PostgreSQL.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2013-04-13 11:56:26 -05:00
parent c588d1c85f
commit f2a6316be0

View File

@ -0,0 +1,3 @@
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE INDEX packages_pkgname_trgm_gist ON packages USING gist (UPPER(pkgname) gist_trgm_ops);
CREATE INDEX packages_pkgdesc_trgm_gist ON packages USING gist (UPPER(pkgdesc) gist_trgm_ops);