Re: Pointers needed on optimizing slow SQL statements - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: Pointers needed on optimizing slow SQL statements
Date
Msg-id dcc563d10906032231k4f28bf80r87c27e16db0653d0@mail.gmail.com
Whole thread Raw
In response to Re: Pointers needed on optimizing slow SQL statements  (Janine Sisk <janine@furfly.net>)
List pgsql-performance
On Wed, Jun 3, 2009 at 8:32 PM, Janine Sisk <janine@furfly.net> wrote:
> I'm sorry if this is a stupid question, but...  I changed
> default_statistics_target from the default of 10 to 100, restarted PG, and
> then ran "vacuumdb -z" on the database.  The plan is exactly the same as
> before.  Was I supposed to do something else?  Do I need to increase it even
> further?  This is an overloaded system to start with, so I'm being fairly
> conservative with what I change.

No need to restart pg, just analyze is good enough (vacuumdb -z will do).

After that, compare your explain analyze output and see if the
estimates are any better.  If they're better but not good enough, try
increasing stats target to something like 500 or 1000 (max is 1000)
and reanalyze and see if that helps.  If not, post the new explain
analyze and we'll take another whack at it.

pgsql-performance by date:

Previous
From: Reid Thompson
Date:
Subject: Re: degenerate performance on one server of 3
Next
From: Marc Cousin
Date:
Subject: Re: Scalability in postgres