Skip site navigation (1) Skip section navigation (2)

Re: Fwd: Help required on query performance

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: dclements89(at)gmail(dot)com
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fwd: Help required on query performance
Date: 2010-02-01 01:13:33
Message-ID: dcc563d11001311713x55abc77bjfb1e13dc8397d469@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Sun, Jan 31, 2010 at 6:09 PM, Dave Clements <dclements89(at)gmail(dot)com> wrote:
> I did the re-analyze serveral times, using the command:
>
> ANALYZE tablename;
>
> Is there any other command as well or another way to do that?

It's important that the stats target get increased as well, it looks
like you're not getting enough buckets to get a good estimate of rows
to be returned for various conditions.

# show default_statistics_target ;
 default_statistics_target
---------------------------
 10

# alter database smarlowe set default_statistics_target=200;
ALTER DATABASE
# analyze;

Then run the explain analyze again and see if your row estimates are
closer and if the plan changes.

In response to

Responses

pgsql-sql by date

Next:From: Dave ClementsDate: 2010-02-01 01:22:13
Subject: Re: Fwd: Help required on query performance
Previous:From: Dave ClementsDate: 2010-02-01 01:09:11
Subject: Re: Fwd: Help required on query performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group