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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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

Browse pgsql-bugs by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message fazool mein 2010-09-01 02:14:33 Re: Synchronous replication - patch status inquiry
Previous Message Fujii Masao 2010-09-01 01:06:18 Re: Synchronous replication - patch status inquiry