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 AE2D25E40AC for ; Wed, 25 Aug 2004 16:08:07 -0300 (ADT) 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 06636-02 for ; Wed, 25 Aug 2004 19:08:06 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 68CFC5E40BA for ; Wed, 25 Aug 2004 16:08:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7PJ81NR002138; Wed, 25 Aug 2004 15:08:02 -0400 (EDT) To: Richard Huxton Cc: David Price , pgsql-performance@postgresql.org Subject: Re: Optimizer Selecting Incorrect Index In-reply-to: <412CB487.6060704@archonet.com> References: <412CB487.6060704@archonet.com> Comments: In-reply-to Richard Huxton message dated "Wed, 25 Aug 2004 16:47:19 +0100" Date: Wed, 25 Aug 2004 15:08:01 -0400 Message-ID: <2137.1093460881@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/342 X-Sequence-Number: 7978 Richard Huxton writes: > Things to check: > 1. postgresql.conf settings match - different costs could cause this > 2. statistics on the two columns (trn_patno,trn_old_date) - if they > differ considerably between systems that would also explain it. The different estimated row counts could only come from #2. I suspect David has forgotten to run ANALYZE on the second system. I agree that EXPLAIN VERBOSE output is not helpful... regards, tom lane