X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AC6E09DC85F for ; Wed, 1 Feb 2006 16:53:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30643-08 for ; Wed, 1 Feb 2006 16:53:09 -0400 (AST) 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 7111C9DC871 for ; Wed, 1 Feb 2006 16:53:06 -0400 (AST) 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 k11Kr8k8004612; Wed, 1 Feb 2006 15:53:08 -0500 (EST) To: "Kevin Grittner" cc: pgsql-performance@postgresql.org Subject: Re: Planner reluctant to start from subquery In-reply-to: <43E0C8F5.EE98.0025.0@wicourts.gov> References: <43E0AA7E.EE98.0025.0@wicourts.gov> <43E0AA7E.EE98.0025.0@wicourts.gov> <3759.1138822464@sss.pgh.pa.us> <43E0BEDD.EE98.0025.0@wicourts.gov> <43E0BEDD.EE98.0025.0@wicourts.gov> <4218.1138824885@sss.pgh.pa.us> <43E0C4A7.EE98.0025.0@wicourts.gov><43E0C4A7.EE98.0025.0@wicourts.gov> <4359.1138826175@sss.pgh.pa.us> <43E0C8F5.EE98.0025.0@wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Wed, 01 Feb 2006 14:43:01 -0600" Date: Wed, 01 Feb 2006 15:53:08 -0500 Message-ID: <4611.1138827188@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.103 required=5 tests=[AWL=0.103] X-Spam-Score: 0.103 X-Spam-Level: X-Archive-Number: 200602/31 X-Sequence-Number: 17017 "Kevin Grittner" writes: > Since you were so confident it couldn't be the outer join, I went > looking for what else I changed at the same time. I eliminated the code > referencing that table, which contained an OR. I've seen ORs cause > nasty problems with optimizers in the past. I took out the OR in the > where clause, without eliminating that last outer join, and it optimized > fine. I don't think that OR is relevant either, since again it's present in both the well-optimized and badly-optimized variants that you posted. regards, tom lane