Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8B47C2E3276 for ; Wed, 28 Nov 2007 16:35:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 75526-01 for ; Wed, 28 Nov 2007 16:35:11 -0400 (AST) Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 96DC52E0272 for ; Wed, 28 Nov 2007 16:34:50 -0400 (AST) Received: from trofast.ipv6.sesse.net ([2001:700:300:1803:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IxTcM-00065J-VX; Wed, 28 Nov 2007 21:34:47 +0100 Received: from root by trofast.sesse.net with local (Exim 4.68) (envelope-from ) id 1IxTcI-0007yn-4A; Wed, 28 Nov 2007 21:34:42 +0100 Date: Wed, 28 Nov 2007 21:34:42 +0100 From: "Steinar H. Gunderson" To: cluster Cc: pgsql-performance@postgresql.org Subject: Re: Query only slow on first run Message-ID: <20071128203442.GB30600@uio.no> Mail-Followup-To: cluster , pgsql-performance@postgresql.org References: <20071127165543.GY11978@crankycanuck.ca> <23999.1196184368@sss.pgh.pa.us> <056501c83128$55d58a90$8e00a8c0@tridecap.com> <20071127233833.GA24031@uio.no> <15029.1196209554@sss.pgh.pa.us> <474CBF98.6070508@amossen.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux 2.6.20.4 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/363 X-Sequence-Number: 27778 On Wed, Nov 28, 2007 at 09:16:08PM +0100, cluster wrote: > Hmm, actually I still don't understand why it takes 6400 ms to fetch the > rows. As far as I can see the index used is "covering" so that real row > lookups shouldn't be necessary. The indexes don't contain visibility information, so Postgres has to look up the row on disk to verify it isn't dead. > Also, only the the random_numbers induces by questions with status = 1 > should be considered - and this part is a relatively small subset. Again, you'll need to have a combined index if you want this to help you any. /* Steinar */ -- Homepage: http://www.sesse.net/