Re: [SQL] Yet Another (Simple) Case of Index not used

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: [SQL] Yet Another (Simple) Case of Index not used
Дата
Msg-id 20030408185412.C57783-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: [SQL] Yet Another (Simple) Case of Index not used  ("Denis @ Next2Me" <denis@next2me.com>)
Список pgsql-performance
On Tue, 8 Apr 2003, Denis @ Next2Me wrote:

> The kind of requests that I am really interested in are:
> select count(*) from table where table.column like 'pattern%'

If you think an index scan should be faster, you can try
set enable_seqscan=off;
and see if that changes the plan generated by explain and with analyze
you can compare the time used.  Without information on the estimated
selectivity it's hard to say what's right.

If it doesn't use the index (ie, it's still using a sequential scan)
after the enable_seqscan=off it's likely that you didn't initdb in "C"
locale in which case like won't use indexes currently (you can see the
archives for long description, but the short one is that some of the
locale rules can cause problems with using the index).


В списке pgsql-performance по дате отправления:

Предыдущее
От: "Denis @ Next2Me"
Дата:
Сообщение: Re: [SQL] Yet Another (Simple) Case of Index not used
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: [SQL] Yet Another (Simple) Case of Index not used