On Mon, Feb 16, 2009 at 11:09:59AM -0500, Chris Mayfield wrote: > >With recent versions of Linux you can flush the system's buffer cache by > >doing: > > > > # echo 3 > /proc/sys/vm/drop_caches > > You can also try something like this: > http://wiki.services.openoffice.org/wiki/Cold-start-simulator > > Shutting down the server and running fillmem has worked for me, but that > might take too long in your situation of thousands of small queries. Why is this better than asking the kernel to drop its caches? The kernel could reasonably assume that because you only touched the data in a page once it could swap the "fillmem"s data out in preference to the page cache. Even if it did, you need to restart the server which is what prevents testing going quickly in the first place. > But I guess "SELECT * FROM large_table" would have taken just as long > anyway. This doesn't work on several levels any more; PG is smart enough to recognize that this is what's happening and only uses a small buffer for this (256KB at the moment). Linux can be smart enough as well which is why you need to ask it to drop the page cache. -- Sam http://samason.me.uk/ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general