Re: 7.3 no longer using indexes for LIKE queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Gabeler-Lee <mgabelerlee(at)zycos(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: 7.3 no longer using indexes for LIKE queries
Date: 2002-12-04 16:50:42
Message-ID: 14882.1039020642@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Gabeler-Lee <mgabelerlee(at)zycos(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2002-12-04 17:02:06 Re: Efficient Boolean Storage
Previous Message Tom Lane 2002-12-04 16:40:48 Re: Backend message type 0x50 arrived while idle