Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CBB1C6501DD for ; Thu, 18 Sep 2008 15:14:41 -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 80513-02-7 for ; Thu, 18 Sep 2008 15:14:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id BA65565016A for ; Thu, 18 Sep 2008 15:13:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m8IIDKgB023588; Thu, 18 Sep 2008 14:13:20 -0400 (EDT) To: "Kevin Grittner" cc: "Nikolas Everett" , pgsql-performance@postgresql.org Subject: Re: Why does this query write to the disk? In-reply-to: <48D24E6C.EE98.0025.0@wicourts.gov> References: <48D24E6C.EE98.0025.0@wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Thu, 18 Sep 2008 12:49:48 -0500" Date: Thu, 18 Sep 2008 14:13:20 -0400 Message-ID: <23587.1221761600@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/181 X-Sequence-Number: 31494 "Kevin Grittner" writes: > "Nikolas Everett" wrote: >> I'm a bit confused as to why this query writes to the disk: > 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 Hint-bit updates wouldn't be WAL-logged. If the table has been around a long time, it might be freezing old tuples, which *would* be WAL-logged (since 8.2 or so) --- but that would be a one-time, non-repeatable behavior. How sure are you that there was WAL output? What I was thinking was more likely was that the hash table for the hash join was spilling out to temp files. That wouldn't be WAL-logged either, but depending on your tablespace setup it might result in I/O on some other disk than the table proper. regards, tom lane