Re: The planner chooses seqscan+sort when there is an index on the sort column - Mailing list pgsql-general

From John D. Burger
Subject Re: The planner chooses seqscan+sort when there is an index on the sort column
Date
Msg-id 1578e3296e30a207a72f0d8ed613f4a3@mitre.org
Whole thread Raw
In response to The planner chooses seqscan+sort when there is an index on the sort column  (Csaba Nagy <nagy@ecircle-ag.com>)
Responses Re: The planner chooses seqscan+sort when there is an  (Csaba Nagy <nagy@ecircle-ag.com>)
List 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 by date:

Previous
From: Csaba Nagy
Date:
Subject: The planner chooses seqscan+sort when there is an index on the sort column
Next
From: Andreas Kretschmer
Date:
Subject: Re: The planner chooses seqscan+sort when there is an index on the sort column