Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1D9311336B42 for ; Wed, 8 Dec 2010 21:41:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 00626-09 for ; Thu, 9 Dec 2010 01:41:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f174.google.com (mail-yx0-f174.google.com [209.85.213.174]) by mail.postgresql.org (Postfix) with ESMTP id 95684133655C for ; Wed, 8 Dec 2010 21:41:44 -0400 (AST) Received: by yxt3 with SMTP id 3so1083470yxt.19 for ; Wed, 08 Dec 2010 17:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HkL5Jb11hs3OZ5k9wF6ziDdT24g8wKioPvrWZgiFPtw=; b=Q/yUz8nqzNLuOos5l9t2PbvyAvBPiqtJemrLl/8JAZzabir6Oh11+A8zzzDowIpKyd cPbcBiyESdXVxXizvcHF9F5BG7B9RLSDvyxJTtJ8V54Vc169Tn0dxjjPlC/hBFFT7u+R sYZmZqgEHOSVYCQ0v2WU77mn+eF4PfJpBzYm4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bqmRJQEH0gS2J9/N2jczZIZ+rzAeL0m/ly7Aj58j4o/DvkhGeHitOxjIE0CnFx+BaH 9FECxQ7vMF4ZVpgvpB8IoaDfQ3KjjpUD6SBcNWRt8QPLXkq4PiRNLmkAETMQMDf+BabK OYrRAQCHOAni07pCTgtnLDUX6Zs+MinB80slY= MIME-Version: 1.0 Received: by 10.42.169.4 with SMTP id z4mr335222icy.172.1291858904704; Wed, 08 Dec 2010 17:41:44 -0800 (PST) Received: by 10.42.241.196 with HTTP; Wed, 8 Dec 2010 17:41:44 -0800 (PST) In-Reply-To: <21911.1291845739@sss.pgh.pa.us> References: <14229.1291818863@sss.pgh.pa.us> <21911.1291845739@sss.pgh.pa.us> Date: Wed, 8 Dec 2010 20:41:44 -0500 Message-ID: Subject: Re: Performance under contention From: Robert Haas To: Tom Lane Cc: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= , Ivan Voras , Jignesh Shah , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201012/131 X-Sequence-Number: 41583 2010/12/8 Tom Lane : > 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. =A0The 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. =A0Those 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. =A0I think at least deadlock detection does. Sure, but it doesn't use the hash table to do it. All the PROCLOCKs for any given LOCK are in a linked list; we just walk it. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company