Re: Running a query twice to ensure cached results. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Running a query twice to ensure cached results.
Date
Msg-id 29989.1149794131@sss.pgh.pa.us
Whole thread Raw
In response to Running a query twice to ensure cached results.  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-hackers
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
>   Does running a query only twice really insure that a result is cached?
>   It seems not to be the case for seq-scans on Linux.

Should work for tables small enough to fit into the shared_buffers
arena.  I wouldn't necessarily assume it for large tables.

Note that what I was really doing was taking the timing measurement
again on data cached by the *first* run, so that I would have something
that could fairly be compared to the following EXPLAIN ANALYZE --- which
of course would likewise be operating on cached data.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ADD/DROP INHERITS
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] drop if exists remainder