Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5CE42632B8D for ; Thu, 26 Aug 2010 13:50:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 87132-05 for ; Thu, 26 Aug 2010 16:50:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from adonis.tweakers.net (adonis.tweakers.net [213.239.154.11]) by mail.postgresql.org (Postfix) with ESMTP id 300B963277E for ; Thu, 26 Aug 2010 13:50:14 -0300 (ADT) Received: from [192.168.1.33] (82-169-23-111.ip.telfort.nl [82.169.23.111]) by adonis.tweakers.net (Postfix) with ESMTPSA id 52FBD20D81 for ; Thu, 26 Aug 2010 18:50:12 +0200 (CEST) Message-ID: <4C769B43.2080407@tweakers.net> Date: Thu, 26 Aug 2010 18:50:11 +0200 From: Arjen van der Meijden User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: turn off caching for performance test References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/283 X-Sequence-Number: 40126 Isn't it more fair to just flush the cache before doing each of the queries? In real-life, you'll also have disk caching... Flushing the buffer pool is easy, just restart PostgreSQL (or perhaps there is a admin command for it too?). Flushing the OS-disk cache is obviously OS-dependent, for linux its trivial: http://linux-mm.org/Drop_Caches Best regards, Arjen On 26-8-2010 12:32 Willy-Bas Loos wrote: > Hi, > > I have a colleague that is convinced that the website is faster if > enable_seqscan is turned OFF. > I'm convinced of the opposite (better to leave it ON), but i would like > to show it, prove it to him. > Now the first query we tried, would do a bitmap heap scan instead of a > seqscan when the latter were disabled, to exclude about 50% of the > records (18K of 37K records). > The bitmap heap scan is 3% faster, so that didn't really plea my case. > The thing is that by the time we tried it, the data had been cached, so > there is no penalty for the use of the index (HDD retention on random > access). So it's logical that the index lookup is faster, it looks up > less records. > > Now i'm looking for a way to turn off the caching, so that we'll have a > fair test. > > It makes no sense to me to set shared_buffers really low. Any tips? > > Cheers, > > WBL > > > -- > "Patriotism is the conviction that your country is superior to all > others because you were born in it." -- George Bernard Shaw