Re: quickly getting the top N rows

From: Ben <bench(at)silentmedia(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: quickly getting the top N rows
Date: 2007-10-04 21:16:49
Message-ID: Pine.LNX.4.64.0710041414590.30864@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 4 Oct 2007, Tom Lane wrote:

> There's some limited smarts in there about deciding that leading columns
> of an index don't matter to the sort ordering if they're constrained to
> just one value by the query. But it doesn't catch the case you need,
> which is that columns of an ORDER BY request are no-ops when they're
> constrained to just one value.

Oh, no, that explains it perfectly, because that's precisely the case I
have - I dropped the columns from the ordering, but not the where clause.
Thanks, now I understand the current behavior.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2007-10-04 23:43:31 Re: Query taking too long. Problem reading explain output.
Previous Message Henrik 2007-10-04 21:15:47 Re: Query taking too long. Problem reading explain output.