Received: from maia.hub.org (unknown [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 27EBAB5DDA7 for ; Thu, 14 Jul 2011 11:31:09 -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 01072-03 for ; Thu, 14 Jul 2011 14:28:31 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id EA1C2B5DC33 for ; Thu, 14 Jul 2011 11:09:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mx1.hub.org (Postfix) with ESMTP id D10F727FDA53 for ; Thu, 14 Jul 2011 11:09:42 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 14 Jul 2011 09:05:43 -0500 Message-Id: <4E1EB165020000250003F2FC@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 14 Jul 2011 09:05:41 -0500 From: "Kevin Grittner" To: "Tom Lane" Cc: "Ivan Voras" , , "lars" Subject: Re: UPDATEDs slowing SELECTs in a fully cached database 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> In-Reply-To: <11679.1310595677@sss.pgh.pa.us> 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-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, NO_DNS_FOR_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201107/147 X-Sequence-Number: 44359 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. > Another approach we could take (also nontrivial) is to prevent > select-only queries from doing HOT cleanups. You said upthread > that there were alleged performance benefits from aggressive > cleanup, but IMO that can charitably be described as unproven. > The real reason it happens is that we didn't see a simple way for > page fetches to know soon enough whether a tuple update would be > likely to happen later, so they just do cleanups unconditionally. Hmm. One trivial change could be to skip it when the top level transaction is declared to be READ ONLY. At least that would give people a way to work around it for now. Of course, that can't be back-patched before 9.1 because subtransactions could override READ ONLY before that. -Kevin