Re: 7.3 no longer using indexes for LIKE queries - Mailing list pgsql-general

From Tom Lane
Subject Re: 7.3 no longer using indexes for LIKE queries
Date
Msg-id 14882.1039020642@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.3 no longer using indexes for LIKE queries  (Matthew Gabeler-Lee <mgabelerlee@zycos.com>)
List pgsql-general
Matthew Gabeler-Lee <mgabelerlee@zycos.com> writes:
> Can someone please elaborate on why it stops doing this optimization?  The
> only reasons for it that I can think of for it to be unsafe in a locale is
> that two characters that are not the same character still compare as being
> equal (does this ever really happen?).

Unfortunately, locale-dependent sorting rules are much stranger than you
seem to think.  You can dig in the pghackers archives for some of the
reasons that we had to disable that optimization (we tried repeatedly to
find ways around this, btw).  Special digraph rules and multipass
comparisons are a couple of examples of things that completely break
the LIKE optimization.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backend message type 0x50 arrived while idle
Next
From: Csaba Nagy
Date:
Subject: Re: Efficient Boolean Storage