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

From Joe Conway
Subject Re: 7.3 no longer using indexes for LIKE queries
Date
Msg-id 3DED4CBB.4010200@joeconway.com
Whole thread Raw
In response to 7.3 no longer using indexes for LIKE queries  (Matthew Gabeler-Lee <mgabelerlee@zycos.com>)
List pgsql-general
Matthew Gabeler-Lee wrote:
> I have a database that has a lot of records (~6mil, iirc), with a varchar
> column that often wants to be queried using something like "where acc like
> 'foo%'".  There is a B-Tree index on the acc column.  In 7.2.3, Postgres
> would use that index to do the queries and things were lightning fast.  In
> 7.3, it is refusing to use the index, even if I set enable_seqscan = off,
> meaning that the query that used to take a few msec now takes a few aeons.
> I've run vacuum analyze on the whole database, and it doesn't change
> anything.

Whats the output of pg_controldata, specifically, what is LC_COLLATE? If it
isn't "C", then LIKE won't use your index.

See:
http://developer.postgresql.org/docs/postgres/charset.html

Joe


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: 7.3 no longer using indexes for LIKE queries
Next
From: Matthew Gabeler-Lee
Date:
Subject: Re: 7.3 no longer using indexes for LIKE queries