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

From Tom Lane
Subject pgsql: Support indexing of regular-expression searches in contrib/pg_tr
Date
Msg-id E1UPQm1-0005l6-01@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pgsql: README comments on checksums on page holes.
Next
From: Robert Haas
Date:
Subject: pgsql: Adjust ExplainOneQuery_hook_type to take a DestReceiver argument