X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B771953534 for ; Sun, 10 Apr 2005 18:27:24 +0100 (BST) 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 99202-06 for ; Sun, 10 Apr 2005 17:27:16 +0000 (GMT) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by svr1.postgresql.org (Postfix) with ESMTP id 70A405350F for ; Sun, 10 Apr 2005 18:27:14 +0100 (BST) Received: from gnari ([157.157.159.208] [157.157.159.208]) by quasar.skima.is with ESMTP; Sun, 10 Apr 2005 17:27:13 Z Subject: Re: subselect query time and loops problem From: Ragnar =?ISO-8859-1?Q?Hafsta=F0?= To: pankaj naug Cc: pgsql-sql@postgresql.org, Tom Lane In-Reply-To: <20050410145429.78732.qmail@web30504.mail.mud.yahoo.com> References: <20050410145429.78732.qmail@web30504.mail.mud.yahoo.com> Content-Type: text/plain Date: Sun, 10 Apr 2005 17:29:04 +0000 Message-Id: <1113154144.7444.49.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/140 X-Sequence-Number: 21033 On Sun, 2005-04-10 at 07:54 -0700, pankaj naug wrote: > [quoting Tom] > >Evidently one has been analyzed much more recently than the other, > because the estimated row counts are wildly different. > > Both the explain/analyse queries has been run at the same time. in that case, is the data the same? if so, what about STATISTICS settings for relevant columns? just to make things clear, have both databases have been ANALYZEd or VACUUM ANALYZEd recently ? (in case your 'explain/analyse' only refers to a EXPLAIN ANALYZE) gnari