Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6E5C21337B55 for ; Wed, 8 Dec 2010 10:34:34 -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 39022-03 for ; Wed, 8 Dec 2010 14:34:28 +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 62136133798E for ; Wed, 8 Dec 2010 10:34:26 -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 oB8EYOZe014230; Wed, 8 Dec 2010 09:34:24 -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: Comments: In-reply-to Robert Haas message dated "Tue, 07 Dec 2010 23:24:14 -0500" Date: Wed, 08 Dec 2010 09:34:23 -0500 Message-ID: <14229.1291818863@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/104 X-Sequence-Number: 41556 Robert Haas writes: >> Yeah, that was my concern, too, though Tom seems skeptical (perhaps >> rightly). šAnd I'm not really sure why the PROCLOCKs need to be in a >> hash table anyway - if we know the PROC and LOCK we can surely look up >> the PROCLOCK pretty expensively by following the PROC SHM_QUEUE. > Err, pretty INexpensively. There are plenty of scenarios in which a proc might hold hundreds or even thousands of locks. pg_dump, for example. You do not want to be doing seq search there. 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. Of course, you'd still have to replicate all the space-management functionality of a shared hash table. regards, tom lane