Re: The planner chooses seqscan+sort when there is an index on the sort column

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: The planner chooses seqscan+sort when there is an index on the sort column
Дата
Msg-id 1578e3296e30a207a72f0d8ed613f4a3@mitre.org
обсуждение исходный текст
Ответ на The planner chooses seqscan+sort when there is an index on the sort column  (Csaba Nagy <nagy@ecircle-ag.com>)
Ответы Re: The planner chooses seqscan+sort when there is an  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
Csaba Nagy wrote:

> select * from table order by col_1;
>
> Isn't it supposed to choose the index scan at least when
> enable_seqscan=off ? Even if it is indeed not faster to do the index
> scan than seqscan+sort.

I think because you've asked for every row, it's going to have to scan
the whole table anyway, to determine MVCC "liveness" of the rows
(sorry, dunno what the correct word is).

- John Burger
   MITRE


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

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: The planner chooses seqscan+sort when there is an index on the sort column
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: The planner chooses seqscan+sort when there is an index on the sort column