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