Re: Discarding the resulting rows

From: "Murali M(dot) Krishna" <murali1729(at)yahoo(dot)com>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Discarding the resulting rows
Date: 2010-04-26 23:40:48
Message-ID: 146661.38681.qm@web52803.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello All:

The optimizer assumes that data is disk resident when computing the cost of a query plan.
I am trying to ascertain what the correlation is between times and costs of some benchmark queries to see how good the cost model is.

Since I have more than 100 queries, it would be painful to stop and start the server each time to force all the buffer pages out. Also, some of these queries have large number of result rows. I don't want the time to be skewed by the output time.

Cheers,

Murali.

-----------------------------------------------------------------
Please visit NumberFest.com for educational number puzzles & mind exercises for all ages! And please tell your friends about it. Thank You!

--- On Mon, 4/26/10, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [HACKERS] Discarding the resulting rows
To: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org, "Murali M. Krishna" <murali1729(at)yahoo(dot)com>
Date: Monday, April 26, 2010, 1:25 PM

Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> writes:
> On Mon, Apr 26, 2010 at 3:03 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Mon, Apr 26, 2010 at 3:36 PM, Kevin Grittner
>> <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
>>> I would use EXPLAIN ANALYZE SELECT ...
>>
>> There's some overhead to that, of course.

> he could see the "actual time" in the very first row of the EXPLAIN
> ANALYZE... isn't that a value that is more close to what the OP is
> looking for?

Well, it will include the instrumentation overhead of EXPLAIN ANALYZE,
which can be nontrivial depending on your hardware and the query plan.

On the other hand, EXPLAIN skips the cost of converting the result data
to text form, not to mention the network overhead of delivering it; so
in another sense it's underestimating the work involved.

I guess the real question is exactly what the OP is hoping to measure
and why.

            regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-04-27 01:26:29 pg_migrator
Previous Message Tom Lane 2010-04-26 20:25:35 Re: Discarding the resulting rows