Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B707D2E306E for ; Mon, 11 Feb 2008 12:45:24 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 10291-05-6 for ; Mon, 11 Feb 2008 12:45:17 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4BFBE2E2FE1 for ; Mon, 11 Feb 2008 12:45:01 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1BGig0n002686; Mon, 11 Feb 2008 11:44:42 -0500 (EST) To: Simon Riggs cc: theo@flame.co.za, pgsql-performance@postgresql.org Subject: Re: Optimizer : query rewrite and execution plan ? In-reply-to: <1202723087.4247.150.camel@ebony.site> References: <60F4687513E90748AE8933DEA5D054E79ACBDE@SLAM0018.match-supermarket.com> <1202298826.4252.972.camel@ebony.site> <1202299962.4274.22.camel@localhost6.localdomain6> <9924.1202313626@sss.pgh.pa.us> <1202723087.4247.150.camel@ebony.site> Comments: In-reply-to Simon Riggs message dated "Mon, 11 Feb 2008 09:44:47 +0000" Date: Mon, 11 Feb 2008 11:44:42 -0500 Message-ID: <2685.1202748282@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/98 X-Sequence-Number: 28640 Simon Riggs writes: > Say if cost of best plan >= N then recheck query for strangeness. If > anything found, re-plan query. Whatever makes you think that would be useful? The usual result of undetected duplicate WHERE clauses is an *underestimate* of runtime, not an overestimate (because it thinks too few tuples will be selected). regards, tom lane