Re: Discarding the resulting rows

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>, "Murali M(dot) Krishna" <murali1729(at)yahoo(dot)com>
Subject: Re: Discarding the resulting rows
Date: 2010-04-26 19:36:02
Message-ID: 4BD5A4D20200002500030E0B@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Murali M. Krishna" <murali1729(at)yahoo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-04-26 19:40:27 Re: global temporary tables
Previous Message Simon Riggs 2010-04-26 19:30:47 Re: global temporary tables