From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-sql@postgresql.org
Cc: andrew <andrew.ylzhou@gmail.com>
Subject: Re: filtering after join
Date: Thu, 26 Jan 2006 11:27:05 +0100
Message-ID: <200601261127.05442.peter_e@gmx.net> (raw)
In-Reply-To: <29d3b0b90601251213g7f90dac7x9c524544ba72f61b@mail.gmail.com>
References: <29d3b0b90601250927o2a5ee6e6mc33a7647da4438ce@mail.gmail.com>
<200601252011.13465.peter_e@gmx.net>
<29d3b0b90601251213g7f90dac7x9c524544ba72f61b@mail.gmail.com>
andrew wrote:
> Sorry for the confusion. This is what i meant. Thanks, Michael.
>
> select *
> from (select * from A, B where A.a = B.b) as s
> where foo(s) < 2;
>
> On 1/25/06, Peter Eisentraut <peter_e@gmx.net> 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=B.b;
Note that these two queries will produce the same internal execution
plan, so if you wanted to make some difference you will not.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: peter_e@gmx.net, andrew.ylzhou@gmail.com
Subject: Re: filtering after join
In-Reply-To: <200601261127.05442.peter_e@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox