Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZAax-0005jp-A5 for pgsql-performance@arkaria.postgresql.org; Mon, 06 May 2013 01:52:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UZAaw-0006kf-IS for pgsql-performance@arkaria.postgresql.org; Mon, 06 May 2013 01:52:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZAav-0006kZ-G2 for pgsql-performance@postgresql.org; Mon, 06 May 2013 01:52:01 +0000 Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZAaq-00048u-IF for pgsql-performance@postgresql.org; Mon, 06 May 2013 01:51:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 990533341B; Mon, 6 May 2013 13:51:52 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhExa46UADXf; Mon, 6 May 2013 13:51:50 +1200 (NZST) Received: from [192.168.1.64] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id AD1C432F67; Mon, 6 May 2013 13:51:50 +1200 (NZST) Message-ID: <51870CB6.6090404@catalyst.net.nz> Date: Mon, 06 May 2013 13:51:50 +1200 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: Simon Riggs CC: Tom Lane , Gavin Flower , "pgsql-performance@postgresql.org" Subject: Re: In progress INSERT wrecks plans on table References: <5179E77B.7050601@catalyst.net.nz> <5179ECC5.2010206@archidevsys.co.nz> <5179F259.3010509@catalyst.net.nz> <5179F5C6.8070702@archidevsys.co.nz> <5180E3C8.3010201@catalyst.net.nz> <2121.1367417215@sss.pgh.pa.us> <5181B80D.70404@catalyst.net.nz> <916bff05a5ab130c76d7835abbaf7762.squirrel@mail.catalyst.net.nz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 05/05/13 00:49, Simon Riggs wrote: > On 3 May 2013 13:41, Simon Riggs wrote: > >> (3) to make the check on TransactionIdIsInProgress() into a heuristic, >> since we don't *need* to check that, so if we keep checking the same >> xid repeatedly we can reduce the number of checks or avoid xids that >> seem to be long running. That's slightly more coding than my quick >> hack here but seems worth it. >> >> I think we need both (1) and (3) but the attached patch does just (1). >> >> This is a similar optimisation to the one I introduced for >> TransactionIdIsKnownCompleted(), except this applies to repeated >> checking of as yet-incomplete xids, and to bulk concurrent >> transactions. > > ISTM we can improve performance of TransactionIdIsInProgress() by > caching the procno of our last xid. > > Mark, could you retest with both these patches? Thanks. > Thanks Simon, will do and report back. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance