Re: Forcing using index instead of sequential scan?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Craig A. James" <cjames@xxxxxxxxxxxxxxxx> 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



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux