Re: Forcing using index instead of sequential scan? - Mailing list pgsql-performance

From Gregory Stark
Subject Re: Forcing using index instead of sequential scan?
Date
Msg-id 87slktteng.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Forcing using index instead of sequential scan?  ("Craig A. James" <cjames@modgraph-usa.com>)
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: "Craig A. James"
Date:
Subject: Re: Forcing using index instead of sequential scan?
Next
From: Mark Kirkwood
Date:
Subject: Re: Forcing using index instead of sequential scan?