Received: from maia.hub.org (unknown [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3E458B5DD6E for ; Thu, 14 Jul 2011 13:01:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78182-06 for ; Thu, 14 Jul 2011 16:01:01 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 320D2B5DD68 for ; Thu, 14 Jul 2011 13:00:16 -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 mx1.hub.org (Postfix) with ESMTP id 20FA827FE02F for ; Thu, 14 Jul 2011 13:00:15 -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 p6EFl14e000465; Thu, 14 Jul 2011 11:47:01 -0400 (EDT) To: "Kevin Grittner" cc: "Ivan Voras" , pgsql-performance@postgresql.org, "lars" Subject: Re: UPDATEDs slowing SELECTs in a fully cached database In-reply-to: <4E1EB165020000250003F2FC@gw.wicourts.gov> References: <4E16479D.3050605@yahoo.com> <4E1A0CBC.6090009@yahoo.com> <4E1A31AB.9010201@postnewspapers.com.au> <1310359653.80687.YahooMailRC@web121705.mail.ne1.yahoo.com> <4E1AEDAB020000250003F1C3@gw.wicourts.gov> <4E1B41EA.90104@yahoo.com> <4E1B05CC020000250003F1E6@gw.wicourts.gov> <4E1B810D.4070404@yahoo.com> <4E1B90AF.1020408@yahoo.com> <4E1C9A05.7060005@yahoo.com> <4E1C5563020000250003F252@gw.wicourts.gov> <4E1CA8E9.6090108@yahoo.com> <4E1CB56E.7080801@yahoo.com> <4E1D697C020000250003F29A@gw.wicourts.gov><4E1D697C020000250003F29A@gw.wicourts.gov> <4752.1310570261@sss.pgh.pa.us> <4E1DCE81020000250003F2DC@gw.wicourts.gov><4E1DCE81020000250003F2DC@gw.wicourts.gov> <11679.1310595677@sss.pgh.pa.us> <4E1EB165020000250003F2FC@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Thu, 14 Jul 2011 09:05:41 -0500" Date: Thu, 14 Jul 2011 11:47:00 -0400 Message-ID: <464.1310658420@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201107/149 X-Sequence-Number: 44361 "Kevin Grittner" writes: > Tom Lane wrote: >> It seems like we ought to distinguish heap cleanup activities from >> user-visible semantics (IOW, users shouldn't care if a HOT cleanup >> has to be done over after restart, so if the transaction only >> wrote such records there's no need to flush). This'd require more >> process-global state than we keep now, I'm afraid. > That makes sense, and seems like the right long-term fix. It seems > like a boolean might do it; the trick would be setting it (or not) > in all the right places. The implementation I was imagining was to define another bit in the info parameter for XLogInsert, say XLOG_NON_TRANSACTIONAL. This could be a high-order bit that would not go to disk. Anytime it was *not* set, XLogInsert would set a global boolean that would remember that the current transaction wrote a transactional WAL record. This is the right default since the vast majority of call sites are writing records that we would want to have flushed at commit. There are just a couple of places that would need to be changed to add this flag to their calls. regards, tom lane