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

From: "John D(dot) Burger" <john(at)mitre(dot)org>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: The planner chooses seqscan+sort when there is an index on the sort column
Date: 2006-05-03 15:48:54
Message-ID: 1578e3296e30a207a72f0d8ed613f4a3@mitre.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2006-05-03 15:54:33 Re: The planner chooses seqscan+sort when there is an index on the sort column
Previous Message Csaba Nagy 2006-05-03 15:37:32 The planner chooses seqscan+sort when there is an index on the sort column