pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Clements <dclements89@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Fwd: Help required on query performance
Date: Mon, 1 Feb 2010 12:22:13 +1100
Message-ID: <1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.com> (raw)
In-Reply-To: <dcc563d11001311713x55abc77bjfb1e13dc8397d469@mail.gmail.com>
References: <1f30b80c1001290049ub864091r8298fca3daa0eb69@mail.gmail.com>
	<1f30b80c1001311650q264dfda0uf9894cac3b9e0c3e@mail.gmail.com>
	<dcc563d11001311654j4e09a853p9b8f46b0312ba2ad@mail.gmail.com>
	<1f30b80c1001311702g3ed5e895gc6e504ffe23d7840@mail.gmail.com>
	<dcc563d11001311704r2ae38a03r6b4dd739040565f7@mail.gmail.com>
	<1f30b80c1001311709u14758b64u162aad3ace527600@mail.gmail.com>
	<dcc563d11001311713x55abc77bjfb1e13dc8397d469@mail.gmail.com>

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.
>



view thread (10+ messages)  latest in thread

Message-ID: <1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.com>
Permalink:  ../1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.com/
Also on:    postgresql.org/message-id/1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.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-sql@postgresql.org
  Cc: dclements89@gmail.com, scott.marlowe@gmail.com
  Subject: Re: Fwd: Help required on query performance
  In-Reply-To: <1f30b80c1001311722y5f410655nf3fec0091dc2912c@mail.gmail.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