Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOtHB-00072t-OQ for pgsql-performance@arkaria.postgresql.org; Wed, 25 Sep 2013 17:53:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VOtHA-0004wP-P1 for pgsql-performance@arkaria.postgresql.org; Wed, 25 Sep 2013 17:53:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOtH6-0004qu-Im for pgsql-performance@postgresql.org; Wed, 25 Sep 2013 17:53:20 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOtH3-0005ef-6p for pgsql-performance@postgresql.org; Wed, 25 Sep 2013 17:53:20 +0000 Received: from anarazel.de (p54AF4270.dip0.t-ipconnect.de [84.175.66.112]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0Lgt3C-1WBxcN2zBe-00oVlX; Wed, 25 Sep 2013 19:53:13 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 096EA101FD6; Wed, 25 Sep 2013 19:53:13 +0200 (CEST) Date: Wed, 25 Sep 2013 19:53:13 +0200 From: Andres Freund To: Jeff Janes Cc: Josh Berkus , "pgsql-performance@postgresql.org" Subject: Re: Planner performance extremely affected by an hanging transaction (20-30 times)? Message-ID: <20130925175312.GB5578@awork2.anarazel.de> References: <1379944816.30390.YahooMailNeo@web162903.mail.bf1.yahoo.com> <5815.1380018947@sss.pgh.pa.us> <5241CF2A.2070309@agliodbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:IFaYTkvKsWQ2DE47JNVB2be5mYmF2QRSJ9VmaVUk5C8 UQSGFyHPqdxstnTwvhjGJkBE9pqG9C8rG6WS30nS8UePKt66XP nTSRMVoCutYGus/p7WLogV6QISWFmKW1WFWKyEot0O3Y1iZCJS 6inob8OlvYbhyVxc3/VMNlVbUPJ+WCRUBYIXhJ9+8VUIJsbh4u ZQk6XlBHXxtd+6DZxHM6JfydcO4sv3BTpe/jp5A3lYWAJr3KG9 b1HFwII6fZtBoRCtc0SRirpUFrPONhdqmDhq9HxlNxEUQLd769 5IqD9r2uV8YbUzjjfHLA8aekqEsVbs/WyAwyNJZcaI43IDlvI9 roWeQeH99EB3aWpz+hYvfwcXQWVo3wtvNI3dPLrBP X-Pg-Spam-Score: -1.9 (-) 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 2013-09-25 00:06:06 -0700, Jeff Janes wrote: > > On 09/20/2013 03:01 PM, Jeff Janes wrote:> 3) Even worse, asking if a > > given transaction has finished yet can be a > > > serious point of system-wide contention, because it takes the > > > ProcArrayLock, once per row which needs to be checked. So you have 20 > > > processes all fighting over the ProcArrayLock, each doing so 1000 > > times per > > > query. That should be gone in master, we don't use SnapshotNow anymore which had those TransactionIdIsInProgress() calls you're probably referring to. The lookups discussed in this thread now use the statement's snapshot. And all those have their own copy of the currently running transactions. > > Why do we need a procarraylock for this? Seems like the solution would > > be not to take a lock at all; the information on transaction commit is > > in the clog, after all. More clog accesses would hardly improve the situation. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance