Re: Index usage for sorted query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Schaber <schabios(at)logi-track(dot)com>
Cc: PostgreSQL Performance List <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Index usage for sorted query
Date: 2004-11-20 16:48:16
Message-ID: 21432.1100969296@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Markus Schaber <schabios(at)logi-track(dot)com> writes:
> But as it fetches all the rows through the index, why doesn't it
> recognize that, fetching this way, the rows are already sorted by
> l_postcode?

Tell it to "ORDER BY cd, l_postcode".

> Is Postgresql 8 more intelligend in this case?

No.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2004-11-20 19:38:43 Re: tablespace + RAM disk?
Previous Message Pierre-Frédéric Caillaud 2004-11-20 16:12:43 Re: Index usage for sorted query