Re: select distinct, index not used

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: select distinct, index not used
Дата
Msg-id 18380.1239895765@sss.pgh.pa.us
обсуждение исходный текст
Ответ на select distinct, index not used  (Thomas Guettler <hv@tbz-pariv.de>)
Ответы Re: select distinct, index not used  (Sam Mason <sam@samason.me.uk>)
Re: select distinct, index not used  (Thomas Guettler <hv@tbz-pariv.de>)
Список pgsql-general
Thomas Guettler <hv@tbz-pariv.de> writes:
> why does the statement take so long? The column 'lieferant' is indexed. But
> a sequential scan gets done.

It might have something to do with the fact that the planner's idea of
the size of the table is off by a factor of more than 100:

>          ->  Seq Scan on foo_abc_abc  (cost=0.00..468944.11 rows=15404611 width=8) (actual time=0.029..125458.870
rows=115830loops=1) 

You might need to review your vacuuming policy.

(However, a full table indexscan isn't going to be particularly fast in
any case; it's often the case that seqscan-and-sort is the right
decision.  I'm not sure this choice was wrong.)

            regards, tom lane

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

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: select distinct, index not used
Следующее
От: Sam Mason
Дата:
Сообщение: Re: select distinct, index not used