pgsql: Support LIKE and ILIKE index searches via contrib/pg_trgm indexe

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support LIKE and ILIKE index searches via contrib/pg_trgm indexe
Date: 2011-02-01 02:35:09
Message-ID: E1Pk65F-0006aD-I8@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=6e2f3ae8842392c46ccc91a9ce4bba92296890cb

Modified Files
--------------
contrib/pg_trgm/expected/pg_trgm.out | 90 ++++++++++
contrib/pg_trgm/pg_trgm.sql.in | 16 ++-
contrib/pg_trgm/sql/pg_trgm.sql | 25 +++
contrib/pg_trgm/trgm.h | 22 ++-
contrib/pg_trgm/trgm_gin.c | 132 ++++++++++++++--
contrib/pg_trgm/trgm_gist.c | 95 ++++++++++--
contrib/pg_trgm/trgm_op.c | 286 +++++++++++++++++++++++++++++++--
contrib/pg_trgm/uninstall_pg_trgm.sql | 6 +-
doc/src/sgml/pgtrgm.sgml | 18 ++-
9 files changed, 640 insertions(+), 50 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2011-02-01 03:29:12 pgsql: In pg_authid.rolpassword docs, make "md5" appear as a literal.
Previous Message Bruce Momjian 2011-02-01 01:16:18 pgsql: Fix pg_upgrade to create pg_authid restore functions in the 'pos