Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Dieter Rehbein <dieter(dot)rehbein(at)skiline(dot)cc>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?
Date: 2011-04-12 09:07:27
Message-ID: BANLkTikvbf6zfOZg1KB=1prAyMNPkA=ubQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Apr 12, 2011 at 10:59 AM, Dieter Rehbein
<dieter(dot)rehbein(at)skiline(dot)cc> wrote:
> I just executed a VACUUM ANALYZE and now everything performs well. hm, strange.

That probably means you need more statistics - try increasing the
newsfeed's statistics target count.

ALTER TABLE newsfeed_item ALTER COLUMN newsfeed SET STATISTICS <n>;

Try different <n> numbers, you can crank it up to 4000 or perhaps more
in 9.0, but you should start lower I guess.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message tv 2011-04-12 09:33:31 Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?
Previous Message Dieter Rehbein 2011-04-12 08:59:22 Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?