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:
parent
c588d1c85f
commit
f2a6316be0
3
packages/sql/search_indexes.postgresql_psycopg2.sql
Normal file
3
packages/sql/search_indexes.postgresql_psycopg2.sql
Normal 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);
|
Loading…
Reference in New Issue
Block a user