Improve match_special_index_operator() to recognize that LIKE with an
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Mar 2009 03:32:22 +0000 (03:32 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Mar 2009 03:32:22 +0000 (03:32 +0000)
commit6d22a9cd6eac1e4c9cce49f42e0068e7bbfc3b1e
treefc69f9b234a8cbbc643a672bede67fd91ddb1eeb
parent244a5f98cea3be7a9b8e31f41014bca4704f56cb
Improve match_special_index_operator() to recognize that LIKE with an
exact-match pattern (no wildcard) can be index-optimized in some cases where a
prefix-match pattern cannot; specifically, since the required index clause is
simple equality, it works for regular text/varchar indexes even when the
locale is not C.  I'm not sure how often this case really comes up, but since
it requires hardly any additional work to handle it, we might as well get it
right.  Motivated by a discussion on the JDBC list.
src/backend/optimizer/path/indxpath.c