Skip site navigation (1) Skip section navigation (2)

Re: [BUGS] Estimation of Plan quality

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: vamsi krishna <vamsikrishna1902(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] Estimation of Plan quality
Date: 2010-09-01 01:14:12
Message-ID: AANLkTi=y8P04DxRfkxR775EmNU+B54s8hNhSXm9Hq_J_@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
First, this is not a bug.  Don't post to pgsql-bugs unless you're
reporting a bug.

On Tue, Aug 31, 2010 at 4:38 AM, vamsi krishna
<vamsikrishna1902(at)gmail(dot)com> wrote:
> Can someone tell me how to estimate the quality of my plan. For example if
> the ideal query plan generated by Dynamic Programming has a plan quality of
> 1.0, and suppose I generate my query plan with some greedy method or
> something, it will be worse (not as optimal as) than ideal plan by,  say,
> 1.5 or 2.0 times , how can I know this factor?
>
> Should it be estimated from the execution time?

I'm not sure there's one right way to do this.  If you know what the
ideal plan is and how fast it runs, comparing that to the actual plan
seems like a reasonable thing to do...

> In the plan generated by PostgreSQL when I give explain query, I see Plan
> cost at the top of the plan with some exponential value. What does it
> indicate? Is it the estimated execution time? or Is it the search space that
> has been considered during plan execution?

...but if you haven't used the planner enough to understand the
EXPLAIN output, there is a good chance you don't understand it well
enough to experiment with modifications, either.  The answers to the
questions above can be found in our fine documentation, specifically
the second paragraph of the EXPLAIN documentation:

http://www.postgresql.org/docs/8.4/static/sql-explain.html

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

pgsql-hackers by date

Next:From: fazool meinDate: 2010-09-01 02:14:33
Subject: Re: Synchronous replication - patch status inquiry
Previous:From: Fujii MasaoDate: 2010-09-01 01:06:18
Subject: Re: Synchronous replication - patch status inquiry

pgsql-bugs by date

Next:From: Euler Taveira de OliveiraDate: 2010-09-01 14:18:10
Subject: Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
Previous:From: Jeff DavisDate: 2010-08-31 18:41:04
Subject: Re: Exclude constraint problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group