Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2F70B64FCEF for ; Thu, 18 Sep 2008 14:50:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72896-01 for ; Thu, 18 Sep 2008 14:50:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 87FFF64FD12 for ; Thu, 18 Sep 2008 14:50:01 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Thu, 18 Sep 2008 12:49:58 -0500 Message-Id: <48D24E6C.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Thu, 18 Sep 2008 12:49:48 -0500 From: "Kevin Grittner" To: "Nikolas Everett" , Subject: Re: Why does this query write to the disk? References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200809/180 X-Sequence-Number: 31493 >>> "Nikolas Everett" wrote: > I'm a bit confused as to why this query writes to the disk: > SELECT count(*) > FROM bigbigtable > WHERE customerid IN (SELECT customerid FROM > smallcustomertable) > AND x != > 'special' > > AND y IS NULL > > It writes a whole bunch of data to the disk that has the tablespace where > bigbigtable lives as well as writes a little data to the main disk. It > looks like its is actually WAL logging these writes. It's probably writing hint bits to improve performance of subsequent access to the table. The issue is discussed here: http://wiki.postgresql.org/wiki/Hint_Bits -Kevin