Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E772F1337B51 for ; Wed, 23 Feb 2011 13:59:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 41923-01 for ; Wed, 23 Feb 2011 17:59:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id 480931337B5C for ; Wed, 23 Feb 2011 13:59:33 -0400 (AST) Received: by gxk8 with SMTP id 8so1553632gxk.19 for ; Wed, 23 Feb 2011 09:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=vSa9EjxxJLTgufbOR7s1QqxYknCO8xMvacg1rKSaazg=; b=pKMxlxJbsi2AQGm7lJrSRBDh6uTuwhldCapWjUJaVv17jE01p1Z2ZAnwGSMu+K0N1F n1Mdbe1/uTXCSjcETRY5y5rI+MCnxu8RlnhyfVWXUCayrXfcugEteHDchLdbuGfzvzWC oAV5nGxPsVnglJ9Vr8TOAGdg+P6yPVl9C9i84= 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=blJr/84p6pFNn8Bcsp86CMscQsaIONxlmWOLUc3iyci8bz94X79yPmCvEMbeWOmHti u5vuOawccmzXWsrEYwybm81urkvf55B3BdsW9yg864SOFFRTgZKKc16pGJhMKCzORerl qSB0jndAWMBwLZKRuI3VDSSMLlazVa955gw/g= MIME-Version: 1.0 Received: by 10.150.158.11 with SMTP id g11mr400378ybe.238.1298483971070; Wed, 23 Feb 2011 09:59:31 -0800 (PST) Received: by 10.150.191.1 with HTTP; Wed, 23 Feb 2011 09:59:31 -0800 (PST) In-Reply-To: <2316.1298482279@sss.pgh.pa.us> References: <20110202052004.GA26098@tornado.gateway.2wire.net> <20110223042108.GA27781@tornado.gateway.2wire.net> <2316.1298482279@sss.pgh.pa.us> Date: Wed, 23 Feb 2011 12:59:31 -0500 Message-ID: Subject: Re: Exhaustive list of what takes what locks From: Robert Haas To: Tom Lane Cc: Noah Misch , Nikolas Everett , 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: 201102/455 X-Sequence-Number: 42593 On Wed, Feb 23, 2011 at 12:31 PM, Tom Lane wrote: > Robert Haas writes: >> ...but that begs the question of why DROP INDEX needs an >> AccessExclusiveLock. =A0It probably needs such a lock *on the index* but >> I don't see why we'd need it on the table. > > Some other session might be in process of planning a query on the table. > It would be sad if the index it had chosen turned out to have vanished > meanwhile. =A0You could perhaps confine DROP INDEX's ex-lock to the index= , > but only at the price of making the planner take out a lock on every > index it considers even transiently. =A0Which isn't going to be a net > improvement. Oh. I assumed we were doing that anyway. If not, yeah. > (While we're on the subject, I have strong suspicions that most of what > Simon did this cycle on ALTER TABLE lock strength reduction is > hopelessly broken and will have to be reverted. =A0It's on my to-do list > to try to break that patch during beta, and I expect to succeed.) It wouldn't surprise me if there are some holes there. But I'd like to try to preserve as much of it as we can, and I think there's probably a good chunk of it that is OK. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company