"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