From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: optimizer parameters
Date: Sun, 10 Apr 2011 22:40:48 -0400
Message-ID: <4DA26A30.6010208@2ndQuadrant.com> (raw)
In-Reply-To: <4DA23CFE.7020109@fuzzy.cz>
References: <77760.3733.qm@web38606.mail.mud.yahoo.com>
<4DA23CFE.7020109@fuzzy.cz>
On 04/10/2011 07:27 PM, Tomas Vondra wrote:
> But if you need more details, then I quess the best approach to get it
> is to read the sources (search for the cost estimation etc.).
>
There's a small fully worked out example of this in my book too, where I
duplicate the optimizer's EXPLAIN cost computations for a simple query.
The main subtle thing most people don't appreciate fully is how much the
optimizer takes into account two things: the selectivity of operators,
and the expected size of the data being moved around. For example, a
lot of the confusion around "why didn't it use my index?" comes from not
noticing the size of the index involved, and therefore how expensive its
page cost is considered to be.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
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: greg@2ndQuadrant.com
Subject: Re: optimizer parameters
In-Reply-To: <4DA26A30.6010208@2ndQuadrant.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