Howto to clear PostgreSQL cache and how to preload all tuples of a table into the cache? - Mailing list pgsql-general

From Stefan Keller
Subject Howto to clear PostgreSQL cache and how to preload all tuples of a table into the cache?
Date
Msg-id CAFcOn281ov9DGSPtoKEb0Y5CzgUODz7W7spQefqfBsNzHK3Xjg@mail.gmail.com
Whole thread Raw
Responses Re: Howto to clear PostgreSQL cache and how to preload all tuples of a table into the cache?  (Craig Ringer <ringerc@ringerc.id.au>)
Re: Howto to clear PostgreSQL cache and how to preload all tuples of a table into the cache?  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
List pgsql-general
I'd like to clear the PostgreSQL cache (e.g. for benchmarking purposes).
And I'd like to preload all tuples of a table (say mytable_one) into the cache.

AFAIK there is no way to force all caches to be cleared in PostgreSQL
with an SQL command.
The only way to achieve this, seems to restart PG (server), which is
neither an option for benchmarking purposes nor for production.

But:
1. Isn't it possible to achieve a kind-of cache clearing (in a
reliable way) by simply doing a "select * from mytable_two" given
mytable_two is at least as large as mytable_one (which is the one we
want  to benchmark)?

2. I assume that "select * from mytable_one" loads as much of the
tuples as it can into the cache. Are there better ways for preloading
the contents of a table?

Yours, Stefan

pgsql-general by date:

Previous
From: Robert James
Date:
Subject: Denormalizing via SQL
Next
From: David Johnston
Date:
Subject: Re: Denormalizing via SQL