Re: Possible solution for LIKE optimization - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible solution for LIKE optimization
Date
Msg-id 7133.997052509@sss.pgh.pa.us
Whole thread Raw
In response to Possible solution for LIKE optimization  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Possible solution for LIKE optimization
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I have had an idea how the LIKE optimization problem could be solved.

Hmm ... so in a non-ASCII locale, we'd have to look for an index on
strxfrm(A) rather than directly on A.  And the index would need to
use a nonstandard operator set --- ie, *non* locale aware comparison
operators (which might be useful for other purposes anyway).

Interesting thought.  I'm not entirely sure how we'd teach the planner
to do this, but that's probably solvable.

A more significant problem is that I'm still not convinced this gets the
job done, because of the problem of multi-character collation elements.
If "A LIKE 'FOOS%'" should match FOOSS, but SS is treated specially by
the collation rules, does this scheme work?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Possible solution for LIKE optimization
Next
From: Hiroshi Inoue
Date:
Subject: Re: Re: OID wraparound: summary and proposal