git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 5d8117e) | patch
Improve contrib/pg_trgm's heuristics for regexp index searches.
Sun, 6 Apr 2014 00:48:47 +0000 (20:48 -0400)
Sun, 6 Apr 2014 00:48:47 +0000 (20:48 -0400)
commit 80a5cf643adb496abe577a1ca6dc0c476d849c19
Improve contrib/pg_trgm's heuristics for regexp index searches.

When extracting trigrams from a regular expression for search of a GIN or
GIST trigram index, it's useful to penalize (preferentially discard)
trigrams that contain whitespace, since those are typically far more common
in the index than trigrams not containing whitespace. Of course, this
should only be a preference not a hard rule, since we might otherwise end
up with no trigrams to search for. The previous coding tended to produce
fairly inefficient trigram search sets for anchored regexp patterns, as
reported by Erik Rijkers. This patch penalizes whitespace-containing
trigrams, and also reduces the target number of extracted trigrams, since
experience suggests that the original coding tended to select too many
trigrams to search for.

Alexander Korotkov, reviewed by Tom Lane
contrib/pg_trgm/trgm_regexp.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /