Re: Help on indexes

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Help on indexes
Дата
Msg-id web-1460613@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Help on indexes  (Stephane DEWITTE <stephane@smeso.fr>)
Список pgsql-sql
Stephane,

> I don't understanf why it makes a seq scan on table mldecs on cases 2
> and 3,
> according that mldecs(ldec_dec_cod) has an index (named
> ldec_dec_cod_mldecs_key). The base is vacuumed and analyzed every
> night. How
> can I use the ldec_dec_cod_mldecs_key index on mldecs ?

First question: Have you actually measured the execution time of the
various queries?  There are many cases where a Seq Scan is faster than
an Index Scan.  For example, if in Case2, 50% of the entries were
values 'X' of 'Y', then a Seq Scan is the better approach.

Please determine that you actually have a problem with slow execution.Otherwise, the query parser is just doing its
job.

-Josh Berkus


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

Предыдущее
От: Roberto Mello
Дата:
Сообщение: Re: some questions
Следующее
От: Ludwig Lim
Дата:
Сообщение: Rules and Triggers