X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5161C8B9E21 for ; Wed, 23 Feb 2005 16:44:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57224-10 for ; Wed, 23 Feb 2005 16:44:18 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5FE2E8B9D5A for ; Wed, 23 Feb 2005 16:44:17 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1NGiFaZ020026; Wed, 23 Feb 2005 11:44:15 -0500 (EST) To: "Luke Chambers" Cc: pgsql-performance@postgresql.org Subject: Re: Inefficient Query Plans In-reply-to: <1109110085.769681.93070@g14g2000cwa.googlegroups.com> References: <1109110085.769681.93070@g14g2000cwa.googlegroups.com> Comments: In-reply-to "Luke Chambers" message dated "22 Feb 2005 14:08:05 -0800" Date: Wed, 23 Feb 2005 11:44:15 -0500 Message-ID: <20025.1109177055@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/326 X-Sequence-Number: 10655 "Luke Chambers" writes: > The following query plans both result from the very same query run on > different servers. They obviously differ drastically, but I don't why > as one db is a slonied copy of the other with identical postgresql.conf > files. There's an order-of-magnitude difference in the estimated row counts for some of the joins, so it's hardly surprising that different plans would be chosen. Assuming that these are exactly the same Postgres version, the only explanation would be considerably different ANALYZE statistics stored in the two databases. > Both databases are vacuum analyzed nightly. Maybe you should double-check that. regards, tom lane