]> granicus.if.org Git - postgresql/commit
Support LIKE and ILIKE index searches via contrib/pg_trgm indexes.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Feb 2011 02:33:55 +0000 (21:33 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Feb 2011 02:34:49 +0000 (21:34 -0500)
commit6e2f3ae8842392c46ccc91a9ce4bba92296890cb
tree5a672b0b9a6f1b5f0d1b264285cfb5a74574e13e
parent6238473adb119a5a11061e40e159e8c5187fe492
Support LIKE and ILIKE index searches via contrib/pg_trgm indexes.

Unlike Btree-based LIKE optimization, this works for non-left-anchored
search patterns.  The effectiveness of the search depends on how many
trigrams can be extracted from the pattern.  (The worst case, with no
trigrams, degrades to a full-table scan, so this isn't a panacea.  But
it can be very useful.)

Alexander Korotkov, reviewed by Jan Urbanski
contrib/pg_trgm/expected/pg_trgm.out
contrib/pg_trgm/pg_trgm.sql.in
contrib/pg_trgm/sql/pg_trgm.sql
contrib/pg_trgm/trgm.h
contrib/pg_trgm/trgm_gin.c
contrib/pg_trgm/trgm_gist.c
contrib/pg_trgm/trgm_op.c
contrib/pg_trgm/uninstall_pg_trgm.sql
doc/src/sgml/pgtrgm.sgml