How to make LIKE to use index in "abc%" query?

Поиск
Список
Период
Сортировка
Искать
От
Dmitry Koterov
Тема
How to make LIKE to use index in "abc%" query?
Дата
Msg-id
d7df81620710080941l27c46c22y397061975bb15718@mail.gmail.com
Список
Дерево обсуждения
How to make LIKE to use index in "abc%" query? "Dmitry Koterov" <dmitry@koterov.ru>
Re: How to make LIKE to use index in "abc%" query? Dimitri Fontaine <dfontaine@hi-media.com>
Re: How to make LIKE to use index in "abc%" query? Oleg Bartunov <oleg@sai.msu.su>
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 по дате отправления
От: Dave
Дата:
От: Dimitri Fontaine
Дата:
FAQ