pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tv@fuzzy.cz
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Dieter Rehbein <dieter.rehbein@skiline.cc>
Cc: pgsql-performance@postgresql.org
Subject: Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?
Date: Tue, 12 Apr 2011 11:33:31 +0200
Message-ID: <85b1e68e7ad292e4cae8fcfd8c8cb61a.squirrel@sq.gransy.com> (raw)
In-Reply-To: <BANLkTikvbf6zfOZg1KB=1prAyMNPkA=ubQ@mail.gmail.com>
References: <152FFD9B-A288-4329-9C96-0FF0C6A2D418@skiline.cc>
	<BANLkTik6U2MU=s9mxr3=pK3Fp+S4bAJK3Q@mail.gmail.com>
	<CF07BFEA-8AFB-4EF8-BBB1-342F6EF23CC2@skiline.cc>
	<BANLkTikvbf6zfOZg1KB=1prAyMNPkA=ubQ@mail.gmail.com>

> On Tue, Apr 12, 2011 at 10:59 AM, Dieter Rehbein
> <dieter.rehbein@skiline.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.

AFAIK the max value is 10000 and the default is 100. Higher numbers mean
higher overhead, so do not jump to 10000 directly. Set it to 1000 and see
if that helps, etc.

regards
Tomas




view thread (7+ messages)  latest in thread

Message-ID: <85b1e68e7ad292e4cae8fcfd8c8cb61a.squirrel@sq.gransy.com>
Permalink:  ../85b1e68e7ad292e4cae8fcfd8c8cb61a.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/85b1e68e7ad292e4cae8fcfd8c8cb61a.squirrel@sq.gransy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, klaussfreire@gmail.com, dieter.rehbein@skiline.cc
  Subject: Re: performance problem with LIMIT (order BY in DESC order). Wrong index used?
  In-Reply-To: <85b1e68e7ad292e4cae8fcfd8c8cb61a.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox