X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2EF4F9DC86A for ; Wed, 25 Jan 2006 16:13:50 -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 65996-07 for ; Wed, 25 Jan 2006 16:13:50 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by postgresql.org (Postfix) with ESMTP id D313D9DC80D for ; Wed, 25 Jan 2006 16:13:47 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 14so192970nzn for ; Wed, 25 Jan 2006 12:13:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rvqhXWe8DKUgWcLgOHrCmAoUU3Bysr+YabijXG6BA5XNpOxta7Tb/gOdX9i3nolQOF0KRVbOzo7gpK2PuHwdJdZogrw15WKOOvRtU5fzsHn60lsh7nTV9/GkCt0eRq++cgXTEzJZxJGjy+Lg5ECFoeUlTvrK9cj+sTCen0UgKBk= Received: by 10.65.196.6 with SMTP id y6mr694551qbp; Wed, 25 Jan 2006 12:13:48 -0800 (PST) Received: by 10.65.135.2 with HTTP; Wed, 25 Jan 2006 12:13:48 -0800 (PST) Message-ID: <29d3b0b90601251213g7f90dac7x9c524544ba72f61b@mail.gmail.com> Date: Wed, 25 Jan 2006 21:13:48 +0100 From: andrew To: pgsql-sql@postgresql.org Subject: Re: filtering after join In-Reply-To: <200601252011.13465.peter_e@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <29d3b0b90601250927o2a5ee6e6mc33a7647da4438ce@mail.gmail.com> <200601252011.13465.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.232 required=5 tests=[AWL=0.232] X-Spam-Score: 0.232 X-Spam-Level: X-Archive-Number: 200601/171 X-Sequence-Number: 23960 Sorry for the confusion. This is what i meant. Thanks, Michael. select * from (select * from A, B where A.a =3D B.b) as s where foo(s) < 2; On 1/25/06, Peter Eisentraut wrote: > andrew wrote: > > I want to use a UDF to filter tuples t that are generated after a > > join. More specifially, I have a UDF foo(record), which computes a > > value for a given tuple. I can do the filtering before the join. > > e.g.: > > > > select * from A, B where foo(A)<2 and A.a=3DB.b; > > What makes you think that the filtering happens before the join here? > And why would it matter? The results should be all the same. > > -- > Peter Eisentraut > http://developer.postgresql.org/~petere/ > -- andrew