Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 589904764FB for ; Wed, 22 Jan 2003 20:30:15 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2B1C2476D11 for ; Wed, 22 Jan 2003 20:01:23 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0N11K5u025949; Wed, 22 Jan 2003 20:01:20 -0500 (EST) To: Stephan Szabo Cc: Tomasz Myrta , Jan Wieck , Ries van Twisk , pgsql-sql@postgresql.org Subject: Re: To use a VIEW or not to use a View..... In-reply-to: <20030122164324.K4204-100000@megazone23.bigpanda.com> References: <20030122164324.K4204-100000@megazone23.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Wed, 22 Jan 2003 16:45:10 -0800" Date: Wed, 22 Jan 2003 20:01:20 -0500 Message-ID: <25948.1043283680@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/350 X-Sequence-Number: 11215 Stephan Szabo writes: > On Wed, 22 Jan 2003, Tom Lane wrote: >> Stephan Szabo writes: >>> The filter is applied only to a. So, if you really wanted the >>> c.a=3 condition to be applied for whatever reason you're out of >>> luck. >> >> FWIW, CVS tip is brighter: the condition does propagate to both relations. > Yeah. I was going to ask how hard you thought it would be to do for > this particular sort of case. I thought about the simple case of using > and realized it'd probably be reasonable in amount of work, but it seems > I don't have to think about it. :) It could still use more eyeballs looking at it. One thing I'm concerned about is whether the extra (derived) conditions lead to double-counting restrictivity and thus underestimating the number of result rows. I haven't had time to really test that, but I suspect there may be a problem. regards, tom lane