Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id A3CA52E008B for ; Wed, 14 May 2008 22:40:10 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 90108-02 for ; Wed, 14 May 2008 22:39:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by developer.postgresql.org (Postfix) with ESMTP id 8739E2E006D for ; Wed, 14 May 2008 22:40:01 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m4F1e0BB001918 for ; Wed, 14 May 2008 21:40:00 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m4F1e0rs001915 for ; Wed, 14 May 2008 21:40:00 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Wed, 14 May 2008 21:39:59 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: pgsql-performance@postgresql.org Subject: Re: I/O on select count(*) In-Reply-To: <482B1D5F.EE98.0025.0@wicourts.gov> Message-ID: References: <920841.71690.qm@web44808.mail.sp1.yahoo.com> <482B1D5F.EE98.0025.0@wicourts.gov> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/189 X-Sequence-Number: 30157 On Wed, 14 May 2008, Kevin Grittner wrote: > If this is the first time that the rows are being read since they were > inserted (or since the database was loaded, including from backup), it > may be rewriting the rows to set hint bits, which can make subsequent > access faster. This is the second time this has come up recently, and I know it used to puzzle me too. This is a particularly relevant area to document better for people doing benchmarking. As close I've found to a useful commentary on this subject is the thread at http://archives.postgresql.org/pgsql-patches/2005-07/msg00390.php I still don't completely understand this myself though, if I did I'd add a FAQ on it. Anyone want to lecture for a minute on the birth and care of hint bits? I'll make sure any comments here get onto the wiki. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD