Re: Fwd: Help required on query performance - Mailing list pgsql-sql

From Dave Clements
Subject Re: Fwd: Help required on query performance
Date
Msg-id 1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: Help required on query performance  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-sql
After doing an analyze on the database, it improved a lot :)



On Mon, Feb 1, 2010 at 12:13 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Sun, Jan 31, 2010 at 6:09 PM, Dave Clements <dclements89@gmail.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.
>


pgsql-sql by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Fwd: Help required on query performance
Next
From: Tom Lane
Date:
Subject: Re: Fwd: Help required on query performance