evorepo/packages/sql/search_indexes.postgresql_psycopg2.sql
Dan McGee f2a6316be0 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>
2013-04-13 11:57:55 -05:00

4 lines
230 B
SQL

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);