First cut at doing LIKE/regex indexing optimization in
authorTom Lane
Tue, 27 Jul 1999 03:51:11 +0000 (03:51 +0000)
committerTom Lane
Tue, 27 Jul 1999 03:51:11 +0000 (03:51 +0000)
commit9e7e29e6c9dd386a56ab23f419bc358f630cf768
tree43859920134e180b991a001e35173a8a715da440
parent434df3fb7a545637610f02c5491be1d6ce81069f
First cut at doing LIKE/regex indexing optimization in
optimizer rather than parser.  This has many advantages, such as not
getting fooled by chance uses of operator names ~ and ~~ (the operators
are identified by OID now), and not creating useless comparison operations
in contexts where the comparisons will not actually be used as indexquals.
The new code also recognizes exact-match LIKE and regex patterns, and
produces an = indexqual instead of >= and <=.

This change does NOT fix the problem with non-ASCII locales: the code
still doesn't know how to generate an upper bound indexqual for non-ASCII
collation order.  But it's no worse than before, just the same deficiency
in a different place...

Also, dike out loc_restrictinfo fields in Plan nodes.  These were doing
nothing useful in the absence of 'expensive functions' optimization,
and they took a considerable amount of processing to fill in.
12 files changed:
src/backend/nodes/copyfuncs.c
src/backend/nodes/freefuncs.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/pathnode.c
src/backend/parser/gram.y
src/include/catalog/pg_operator.h
src/include/nodes/relation.h
src/include/optimizer/clauses.h
src/include/optimizer/paths.h