X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 968BA9FA0EF for ; Thu, 14 Sep 2006 20:51:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13838-08 for ; Thu, 14 Sep 2006 20:50:47 -0300 (ADT) 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 44F8A9FA0FD for ; Thu, 14 Sep 2006 20:51:03 -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 k8ENowaZ017023; Thu, 14 Sep 2006 19:50:58 -0400 (EDT) To: Jeff Davis cc: andy , Alvaro Herrera , pgsql-hackers@postgreSQL.org Subject: Re: [ADMIN] Vacuum error on database postgres In-reply-to: <1158277217.29889.146.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> <16508.1158272742@sss.pgh.pa.us> <1158277217.29889.146.camel@dogma.v10.wvs> Comments: In-reply-to Jeff Davis message dated "Thu, 14 Sep 2006 16:40:17 -0700" Date: Thu, 14 Sep 2006 19:50:58 -0400 Message-ID: <17022.1158277858@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.107 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/1200 X-Sequence-Number: 90729 Jeff Davis writes: > Couldn't you just sort by the table names, and ANALYZE the tables in > that order? Would that effectively prevent the deadlocks? That'd work too, I think (I suggested the variant of ordering by OID, which is simpler and more reliable). Not sure if it's really worth the trouble though --- how many people do you think are doing concurrent whole-database ANALYZEs inside transaction blocks? As-is the code will do the analyzes in pg_class physical row order, which is almost good enough --- only if someone did a schema change that forced a pg_class row update between the starts of the two ANALYZE runs would it possibly fail. So the use-case for a fix is really kinda narrow. regards, tom lane