X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id ED0699FB1D7 for ; Thu, 14 Sep 2006 19:25:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 72679-02 for ; Thu, 14 Sep 2006 22:25:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B97359FA2B9 for ; Thu, 14 Sep 2006 19:25:47 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k8EMPgnw016509; Thu, 14 Sep 2006 18:25:42 -0400 (EDT) To: Jeff Davis cc: andy , Alvaro Herrera , pgsql-hackers@postgreSQL.org Subject: Re: [ADMIN] Vacuum error on database postgres In-reply-to: <1158271045.29889.143.camel@dogma.v10.wvs> References: <44F82150.5000809@pnlassociates.com> <4001.1157121669@sss.pgh.pa.us> <27602.1158238299@sss.pgh.pa.us> <45095CDD.8090704@squeakycode.net> <29469.1158247230@sss.pgh.pa.us> <1158271045.29889.143.camel@dogma.v10.wvs> Comments: In-reply-to Jeff Davis message dated "Thu, 14 Sep 2006 14:57:25 -0700" Date: Thu, 14 Sep 2006 18:25:42 -0400 Message-ID: <16508.1158272742@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/1194 X-Sequence-Number: 90723 Jeff Davis writes: > How would creating a new lock type avoid deadlocks when an ANALYZE is > accumulating the locks in random order? In itself it wouldn't. Josh Drake sketched the idea in more detail later: if there is a lock type used *only* for ANALYZE, then you can do ConditionalLockAcquire on it, and if you fail, skip the table on the assumption that someone else is already doing what you came to do. The whole thing seems a bit too cute/complicated though; it'd open various corner cases such as: ANALYZE, run complex query, query takes a week because it's using out-of-date stats because previous ANALYZE-r hadn't committed yet. I'd rather ANALYZE always analyzed than sometimes fell through without doing anything. regards, tom lane