From: Gregory Stark <gsstark@mit.edu>
To: Craig A. James <cjames@modgraph-usa.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: robin.c.smith@bt.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Forcing using index instead of sequential scan?
Date: 22 Jul 2006 19:15:31 -0400
Message-ID: <87slktteng.fsf@stark.xeocode.com> (raw)
In-Reply-To: <44C25FDD.8070003@modgraph-usa.com>
References: <D012B9600FFB984AB18C0D53C475A4A081F51B@E03MVZ3-UKDY.domain1.systemhost.net>
<26827.1153585341@sss.pgh.pa.us>
<44C25FDD.8070003@modgraph-usa.com>
"Craig A. James" <cjames@modgraph-usa.com> writes:
> This causes massive file-system activity and flushes all files that the
> kernel has cached. If you run this between each Postgres test (let it run
> for a couple minutes), it gives you an apples-to-apples comparison between
> successive benchmarks, and eliminates the effects of caching.
On Linux at least the best way to flush the cache is to unmount and then mount
the filesystem. This requires putting the data files on partition that you
aren't otherwise using and shutting down postgres.
Note that "nothing cached" isn't necessarily any more accurate a model as
"everything cached". In reality many databases *do* in fact run the same
queries over and over again, though often with some parameters different each
time. But the upper pages of most indexes and many of the common leaf pages
and heap pages will in fact be cached.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: gsstark@mit.edu, cjames@modgraph-usa.com, tgl@sss.pgh.pa.us, robin.c.smith@bt.com
Subject: Re: Forcing using index instead of sequential scan?
In-Reply-To: <87slktteng.fsf@stark.xeocode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox