pgsql: Support indexing of regular-expression searches in contrib/pg_tr

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support indexing of regular-expression searches in contrib/pg_tr
Date: 2013-04-09 05:07:13
Message-ID: E1UPQm1-0005l6-01@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Support indexing of regular-expression searches in contrib/pg_trgm.

This works by extracting trigrams from the given regular expression,
in generally the same spirit as the previously-existing support for
LIKE searches, though of course the details are far more complicated.

Currently, only GIN indexes are supported. We might be able to make
it work with GiST indexes later.

The implementation includes adding API functions to backend/regex/
to provide a view of the search NFA created from a regular expression.
These functions are meant to be generic enough to be supportable in
a standalone version of the regex library, should that ever happen.

Alexander Korotkov, reviewed by Heikki Linnakangas and Tom Lane

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3ccae48f44d993351e1f881761bd6c556ebd6638

Modified Files
--------------
contrib/pg_trgm/Makefile | 4 +-
contrib/pg_trgm/expected/pg_trgm.out | 139 ++-
contrib/pg_trgm/pg_trgm--1.0--1.1.sql | 8 +
contrib/pg_trgm/pg_trgm--1.0.sql | 166 ---
contrib/pg_trgm/pg_trgm--1.1.sql | 172 +++
contrib/pg_trgm/pg_trgm.control | 2 +-
contrib/pg_trgm/sql/pg_trgm.sql | 26 +-
contrib/pg_trgm/trgm.h | 35 +-
contrib/pg_trgm/trgm_gin.c | 49 +-
contrib/pg_trgm/trgm_op.c | 20 +-
contrib/pg_trgm/trgm_regexp.c | 2197 +++++++++++++++++++++++++++++++++
doc/src/sgml/pgtrgm.sgml | 43 +-
src/backend/regex/Makefile | 2 +-
src/backend/regex/README | 9 +-
src/backend/regex/regexport.c | 292 +++++
src/backend/utils/adt/selfuncs.c | 12 +-
src/include/mb/pg_wchar.h | 5 +
src/include/regex/regexport.h | 57 +
18 files changed, 3030 insertions(+), 208 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-04-09 14:27:13 pgsql: Adjust ExplainOneQuery_hook_type to take a DestReceiver argument
Previous Message Simon Riggs 2013-04-08 16:22:11 Re: pgsql: README comments on checksums on page holes.