From: "Kevin Grittner" on
"Murali M. Krishna" <murali1729(a)yahoo.com> wrote:

> Basically, I would like to discard the result rows after doing all
> the work required to execute the query.

I would use EXPLAIN ANALYZE SELECT ...

> I looked at the documentation and I saw something about using the
> keyword PERFORM rather than SELECT.

I don't remember ever seeing anything like that. Do you have a URL?

> How do I clear the buffer caches between two query runs?

The easiest way to clear the PostgreSQL cache is to restart the
service. PostgreSQL goes through the OS cache; so you'll need to
clear that, too. How you do that is dependent on your OS. Of
course, in most real use cases, a significant portion of the
database would be cached, so unless you're dealing with a very
unusual situation, it's hard to see what the value would be of such
a benchmark, unless you're trying to create an artificial "worst
case" scenario for bounding purposes.

Oh, and most serious database servers have 256MB or more of battery
backed cache on the RAID controller; don't forget to deal with that
somehow.

-Kevin

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Jaime Casanova on
On Mon, Apr 26, 2010 at 2:36 PM, Kevin Grittner
<Kevin.Grittner(a)wicourts.gov> wrote:
> "Murali M. Krishna" <murali1729(a)yahoo.com> wrote:
>
>> I looked at the documentation and I saw something about using the
>> keyword PERFORM rather than SELECT.
>
> I don't remember ever seeing anything like that.  Do you have a URL?
>

i guess he is refering to the plpgsql's PERFORM statement, which of
course he can't use outside a plpgsql function...
mmm... well, IIRC, in 9.0 he will be able to do DO $$ PERFORM * FROM
tabla; $$ LANGUAGE plpgsql;

but i think DO is not an EXPLAINing statement

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
On Mon, Apr 26, 2010 at 3:36 PM, Kevin Grittner
<Kevin.Grittner(a)wicourts.gov> wrote:
> "Murali M. Krishna" <murali1729(a)yahoo.com> wrote:
>
>> Basically, I would like to discard the result rows after doing all
>> the work required to execute the query.
>
> I would use EXPLAIN ANALYZE SELECT ...

There's some overhead to that, of course.

.....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Jaime Casanova on
On Mon, Apr 26, 2010 at 3:03 PM, Robert Haas <robertmhaas(a)gmail.com> wrote:
> On Mon, Apr 26, 2010 at 3:36 PM, Kevin Grittner
> <Kevin.Grittner(a)wicourts.gov> wrote:
>> "Murali M. Krishna" <murali1729(a)yahoo.com> wrote:
>>
>>> Basically, I would like to discard the result rows after doing all
>>> the work required to execute the query.
>>
>> 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?

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "Kevin Grittner" on
Robert Haas <robertmhaas(a)gmail.com> wrote:
> On Mon, Apr 26, 2010 at 3:36 PM, Kevin Grittner
> <Kevin.Grittner(a)wicourts.gov> wrote:
>> "Murali M. Krishna" <murali1729(a)yahoo.com> wrote:
>>
>>> Basically, I would like to discard the result rows after doing
>>> all the work required to execute the query.
>>
>> I would use EXPLAIN ANALYZE SELECT ...
>
> There's some overhead to that, of course.

Good point. At the moment I can't think how to do better, though.

Other suggestions, anyone?

-Kevin

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers