pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Corin <wakathane@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: planer chooses very bad plan
Date: Mon, 12 Apr 2010 00:41:19 +0200
Message-ID: <4BC2500F.5000306@gmail.com> (raw)
In-Reply-To: <o2jdcc563d11004111418pca3ad67dyda7e74d5252fd1c1@mail.gmail.com>
References: <4BC23B3E.5020500@gmail.com>
	<o2jdcc563d11004111418pca3ad67dyda7e74d5252fd1c1@mail.gmail.com>

On 11.04.2010 23:18, Scott Marlowe wrote:
> In both instances your number of rows estimated is WAY higher than the
> actual number of rows returned.  Perhaps if you increased
> default_statistics_target to 100, 200, 500 etc. re-analyzed, and then
> reun explain analyze again.
>
> Also increasing work_mem might encourage the bitmap index scans to occur.
>   
Increasing the statistics >= 500 indeed helped a lot and causes the 
planner to choose a good plan. :)

I'm now thinking about increasing the default_statistics_target of the 
whole server from the default (100) to 1000, because I have many tables 
with similar data. As the size of the table index seems not change at 
all, I wonder how much additional storage is needed? I only care about 
runtime performance: are inserts/updates affected by this change? Or is 
only analyze affected (only run once during the night)?

Thanks,
Corin




view thread (8+ messages)  latest in thread

Message-ID: <4BC2500F.5000306@gmail.com>
Permalink:  ../4BC2500F.5000306@gmail.com/
Also on:    postgresql.org/message-id/4BC2500F.5000306@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-performance@postgresql.org
  Cc: wakathane@gmail.com, scott.marlowe@gmail.com
  Subject: Re: planer chooses very bad plan
  In-Reply-To: <4BC2500F.5000306@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