Re: Pointers needed on optimizing slow SQL statements

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Janine Sisk <janine(at)furfly(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Pointers needed on optimizing slow SQL statements
Date: 2009-06-04 05:31:13
Message-ID: dcc563d10906032231k4f28bf80r87c27e16db0653d0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jun 3, 2009 at 8:32 PM, Janine Sisk <janine(at)furfly(dot)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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Marc Cousin 2009-06-04 08:22:14 Re: Scalability in postgres
Previous Message Reid Thompson 2009-06-04 02:35:19 Re: degenerate performance on one server of 3