Improve efficiency of LIKE/ILIKE code, especially for multi-byte charsets,

Andrew Dunstan <andrew@dunslane.net>

Commit: 15f8202c204386b7a3b95b00976b4c1e7ba062c1
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2007-06-02T02:03:42Z
Releases: 8.3.0
Improve efficiency of LIKE/ILIKE code, especially for multi-byte charsets,
and most especially for UTF8. Remove unnecessary special cases for bytea
processing and single-byte charset ILIKE.  a ILIKE b is now processed as
lower(a) LIKE lower(b) in all cases. The code is now considerably simpler. All
comparisons are now performed byte-wise, and the text and pattern are also
advanced byte-wise where it is safe to do so - essentially where a wildcard is
not being matched.
Andrew Dunstan, from an original patch by ITAGAKI Takahiro, with ideas from
Tom Lane and Mark Mielke.

Files

PathChange+/−
src/backend/utils/adt/like.c modified +72 −330
src/backend/utils/adt/like_match.c modified +111 −109