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 07:42:27
Message-ID: BANLkTik6U2MU=s9mxr3=pK3Fp+S4bAJK3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Apr 12, 2011 at 7:20 AM, Dieter Rehbein
<dieter(dot)rehbein(at)skiline(dot)cc> wrote:
> Hi everybody,
>
> I have a performance-problem with a query using a LIMIT. There are other threads rergading performance issues with LIMIT, but I didn't find useful hints for our problem and it might
> be interesting for other postgres-users.

Did you perform an ANALYZE or VACUUM ANALYZE?
Did you try increasing the statistic targets?

AFAIK, it looks a lot like the planner is missing stats, since it
estimates the index query on idx_nfi_newsfeed will fetch 10k rows -
instead of 25.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Sethu Prasad 2011-04-12 07:51:30 DBT-5 & Postgres 9.0.3
Previous Message Claudio Freire 2011-04-12 07:33:50 Re: Slow query postgres 8.3