Re: increasing LIMIT with ORDER BY changes queryplan (7.4) - Mailing list pgsql-general

From Merlin Moncure
Subject Re: increasing LIMIT with ORDER BY changes queryplan (7.4)
Date
Msg-id b42b73150610180642k7b2b36absba73437557233327@mail.gmail.com
Whole thread Raw
In response to increasing LIMIT with ORDER BY changes queryplan (7.4)  ("Jan Harders" <jan@delinquent.de>)
List pgsql-general
On 10/18/06, Jan Harders <jan@delinquent.de> wrote:

> and, as guessed, takes forever. tried to ANALYZE the table but no change.
> Anyone got any ideas? I just don't understand why it's sorting the values
> while the index should already be sorted...
>
> Oh, btw, I'm on 7.4 (sarge stable version). Could this behaviour change if I
> just upgrade to 8.1?

yes :-) if you're feeling frisky, bite the bullet and give 8.2 a spin!

> any input is appreciated - it's not a critical project but just a private
> one I'm using to get familiar with postgre.

8.1 is smarter with these types of queries and just faster generally.
if that doesn't help, its down to tweaking statistics, etc...note that
I rarely, if ever, resort to that type of optimization.

merlin

pgsql-general by date:

Previous
From: "Jan Harders"
Date:
Subject: increasing LIMIT with ORDER BY changes queryplan (7.4)
Next
From: "Merlin Moncure"
Date:
Subject: Re: Moving postgres users accounts from one postgres 7.3 to postgres 8.0