pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@coretech.co.nz>
To: Ragnar Hafstaư <gnari@simnet.is>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgres Optimizer is not smart enough?
Date: Thu, 13 Jan 2005 15:11:12 +1300
Message-ID: <41E5D8C0.5080304@coretech.co.nz> (raw)
In-Reply-To: <1105577416.5220.50.camel@localhost.localdomain>
References: <20050112222506.32084.qmail@web13124.mail.yahoo.com>
	<41E5AF3F.2080100@coretech.co.nz>
	<1105577416.5220.50.camel@localhost.localdomain>

Ragnar Hafstaư wrote:
> 
> 
> 
> it is not rational to have random_page_cost < 1.
>
I agree, in theory one should never *need* to set it < 1. However in
cases when the optimizers understanding of things is a little off,
compensation may be required to achieve better plans (e.g. encouraging
index scans on data with funny distributions or collelations).

> if you see improvement with such a setting, it is as likely that 
> something else is wrong, such as higher statistic targets needed,
> or a much too low effective_cache setting. 
> 
Altho this is good advice, it is not always sufficient. For instance I
have my effective_cache_size=20000. Now the machine has 512Mb ram and
right now cache+buf+free is about 100M, and shared_buffers=2000. So in
fact I probably have it a bit high :-).

Increasing stats target will either make the situation better or worse -
a better sample of data is obtained for analysis, but this is not
*guaranteed* to lead to a faster execution plan, even if in
general/usually it does.

cheers

Mark




view thread (8+ messages)  latest in thread

Message-ID: <41E5D8C0.5080304@coretech.co.nz>
Permalink:  ../41E5D8C0.5080304@coretech.co.nz/
Also on:    postgresql.org/message-id/41E5D8C0.5080304@coretech.co.nz

 · 

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: markir@coretech.co.nz, gnari@simnet.is
  Subject: Re: Postgres Optimizer is not smart enough?
  In-Reply-To: <41E5D8C0.5080304@coretech.co.nz>

* 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