Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D4E811336B42 for ; Wed, 8 Dec 2010 18:02:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 00128-02 for ; Wed, 8 Dec 2010 22:02:26 +0000 (UTC) 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 mail.postgresql.org (Postfix) with ESMTP id 193391337B6D for ; Wed, 8 Dec 2010 18:02:24 -0400 (AST) 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 oB8M2JGe021912; Wed, 8 Dec 2010 17:02:19 -0500 (EST) To: Robert Haas cc: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= , Ivan Voras , Jignesh Shah , pgsql-performance@postgresql.org Subject: Re: Performance under contention In-reply-to: References: <14229.1291818863@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 08 Dec 2010 16:09:17 -0500" Date: Wed, 08 Dec 2010 17:02:19 -0500 Message-ID: <21911.1291845739@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/117 X-Sequence-Number: 41569 Robert Haas writes: > 2010/12/8 Tom Lane : >> Now, it's possible that you could avoid *ever* needing to search for a >> specific PROCLOCK, in which case eliminating the hash calculation >> overhead might be worth it. > That seems like it might be feasible. The backend that holds the lock > ought to be able to find out whether there's a PROCLOCK by looking at > the LOCALLOCK table, and the LOCALLOCK has a pointer to the PROCLOCK. Hm, that is a real good point. Those shared memory data structures predate the invention of the local lock tables, and I don't think we looked real hard at whether we should rethink the fundamental representation in shared memory given the additional local state. The issue though is whether any other processes ever need to look at a proc's PROCLOCKs. I think at least deadlock detection does. regards, tom lane