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

From Matthew Gabeler-Lee
Subject Re: 7.3 no longer using indexes for LIKE queries
Date
Msg-id ABABFB80F35AD311848B0090279918EF010B9B63@ZYCOSNT2.hq.zycos.com
Whole thread Raw
In response to 7.3 no longer using indexes for LIKE queries  (Matthew Gabeler-Lee <mgabelerlee@zycos.com>)
Responses Re: 7.3 no longer using indexes for LIKE queries  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: 7.3 no longer using indexes for LIKE queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Okay, now I understand the problem better.

How about, as an intermediate solution, a list of 'sane' locales in which
the optimization applied to the C/POSIX locale works?  It should be fairly
straight forward to write a test program that will test a locale and see if
any of the common problems apply.  And I expect that several locales can be
added straight away as they are known to obey simple sorting rules.

Alternately, though I don't think this would be a very good idea, a SET
option along the lines of enable_dangerous_like_optimization or such that
would (of course) default to off.

    -Matt


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]

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: pginfo
Date:
Subject: Slow delete by table with reference to him slef.
Next
From: Joe Conway
Date:
Subject: Re: Efficient Boolean Storage