Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UxvWI-0005wV-SZ for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jul 2013 08:49:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UxvWH-0001S2-3R for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jul 2013 08:49:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UxvWE-0001Rs-Qn for pgsql-hackers@postgresql.org; Sat, 13 Jul 2013 08:49:30 +0000 Received: from raven.toroid.org ([178.63.84.200]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UxvWB-0005yW-Nd for pgsql-hackers@postgresql.org; Sat, 13 Jul 2013 08:49:30 +0000 Received: from pipit.toroid.org (unknown [10.9.8.10]) by raven.toroid.org (Postfix) with ESMTP id 8A2D4E500B6; Sat, 13 Jul 2013 10:49:25 +0200 (CEST) Received: by pipit.toroid.org (Postfix, from userid 1000) id 8DCC0460269; Sat, 13 Jul 2013 14:19:23 +0530 (IST) Date: Sat, 13 Jul 2013 14:19:23 +0530 From: Abhijit Menon-Sen To: Jeff Janes Cc: Josh Berkus , Simon Riggs , Mark Kirkwood , Tom Lane , Gavin Flower , pgsql-hackers@postgresql.org Subject: Re: [PERFORM] In progress INSERT wrecks plans on table Message-ID: <20130713084923.GA1011@toroid.org> References: <51870CB6.6090404@catalyst.net.nz> <20130624044350.GA32322@toroid.org> <51DAF2C8.6010705@agliodbs.com> <51DD9026.2030107@agliodbs.com> <20130711050958.GA23755@toroid.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org At 2013-07-12 16:25:14 -0700, jeff.janes@gmail.com wrote: > > I think the reviewer of a performance patch should do some independent > testing of the performance, to replicate the author's numbers; and > hopefully with a few different scenarios. You're quite right. I apologise for being lazy; doubly so because I can't actually see any difference while running the test case with the patches applied. unpatched: before: 1629.831391, 1559.793758, 1498.765018, 1639.384038 during: 37.434492, 37.044989, 37.112422, 36.950895 after : 46.591688, 46.341256, 46.042169, 46.260684 patched: before: 1813.091975, 1798.923524, 1629.301356, 1606.849033 during: 37.344987, 37.207359, 37.406788, 37.316925 after : 46.657747, 46.537420, 46.746377, 46.577052 ("before" is before starting session 2; "during" is after session 2 inserts, but before it commits; "after" is after session 2 issues a rollback.) The timings above are with both xid_in_snapshot_cache.v1.patch and cache_TransactionIdInProgress.v2.patch applied, but the numbers are not noticeably different with only the first patch applied. After I "vacuum plan", the timings in both cases return to normal. In a quick test with gdb (and also in perf report output), I didn't see the following block in procarray.c being entered at all: + if (max_prepared_xacts == 0 && pgprocno >= 0 && + (TransactionIdEquals(xid, pxid) || TransactionIdEquals(xid, cxid))) + { … I'll keep looking, but comments are welcome. I'm setting this back to "Needs Review" in the meantime. -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers