X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3B58F9DC85C for ; Thu, 5 Jan 2006 23:14:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77864-08 for ; Thu, 5 Jan 2006 23:14:23 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from flake.decibel.org (unknown [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id BC80A9DC81A for ; Thu, 5 Jan 2006 23:14:16 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id DE6C539834; Thu, 5 Jan 2006 21:14:21 -0600 (CST) Date: Thu, 5 Jan 2006 21:14:21 -0600 From: "Jim C. Nasby" To: David Lang Cc: Mark Liberman , pgsql-performance@postgresql.org Subject: Re: Help in avoiding a query 'Warm-Up' period/shared buffer Message-ID: <20060106031421.GM43311@pervasive.com> References: <200601041449.43557.mliberman@mixedsignals.com> <200601051815.36181.mliberman@mixedsignals.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.076 required=5 tests=[AWL=0.076] X-Spam-Score: 0.076 X-Spam-Level: X-Archive-Number: 200601/30 X-Sequence-Number: 16508 On Thu, Jan 05, 2006 at 06:50:22PM -0800, David Lang wrote: > On Thu, 5 Jan 2006, Mark Liberman wrote: > > >Obviously, I will be testing this - but it might take a few days, as I > >haven't > >figure out how to simulate the "period of inactivity" to get the data > >flushed > >out of the cache ... so I have to run this each morning. > > cat large_file >/dev/null > > will probably do a pretty good job of this (especially if large_file is > noticably larger then the amount of ram you have) The following C code is much faster... /* * $Id: clearmem.c,v 1.1 2003/06/29 20:41:33 decibel Exp $ * * Utility to clear out a chunk of memory and zero it. Useful for flushing disk buffers */ int main(int argc, char *argv[]) { if (!calloc(atoi(argv[1]), 1024*1024)) { printf("Error allocating memory.\n"); } } Compile it and then pass in the number of MB of memory to allocate on the command line. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461