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 D520652823 for ; Wed, 8 Jun 2005 14:02:47 -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 87743-03 for ; Wed, 8 Jun 2005 17:02:38 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D1B8C5283B for ; Wed, 8 Jun 2005 14:02:37 -0300 (ADT) 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 j58H2aL1004363; Wed, 8 Jun 2005 13:02:36 -0400 (EDT) To: allanvv@gmail.com Cc: pgsql-performance@postgresql.org Subject: Re: Performance problems, bad estimates and plan In-reply-to: <1118243044.3454.3.camel@localhost> References: <1118243044.3454.3.camel@localhost> Comments: In-reply-to Allan Wang message dated "Wed, 08 Jun 2005 11:04:04 -0400" Date: Wed, 08 Jun 2005 13:02:35 -0400 Message-ID: <4362.1118250155@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/179 X-Sequence-Number: 12816 Allan Wang writes: > It seems that Postgres is estimating that all rows in a 50k row table > will be returned, but only one should match. I think this is the same issue fixed here: 2005-04-03 21:43 tgl * src/backend/optimizer/path/: costsize.c (REL7_4_STABLE), costsize.c (REL8_0_STABLE), costsize.c: In cost_mergejoin, the early-exit effect should not apply to the outer side of an outer join. Per andrew@supernews. Are you running 7.4.8 or 8.0.2 or later? regards, tom lane