How to make LIKE to use index in "abc%" query? - Mailing list pgsql-general

From Dmitry Koterov
Subject How to make LIKE to use index in "abc%" query?
Date
Msg-id d7df81620710080941l27c46c22y397061975bb15718@mail.gmail.com
Whole thread Raw
Responses Re: How to make LIKE to use index in "abc%" query?
Re: How to make LIKE to use index in "abc%" query?
List pgsql-general
Hello.

I run

explain analyze
SELECT id FROM "table" WHERE name LIKE 'dt%';

having a btree index on "name" column. But unfortunately it uses seqscan instead of index scan, it's too slow.

I had read some mailing archives about that problem, but have not found a solution. How to fix this LIKE behaviour withour re-creation af the whole database? Is it possible?

I use windows-1251 locale, not C locale.

pgsql-general by date:

Previous
From: "Dave"
Date:
Subject: Re: Foreign Key for PHP serialized data - possible?
Next
From: Dimitri Fontaine
Date:
Subject: Re: How to make LIKE to use index in "abc%" query?