Re: Functions returning sets

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Don Baccus <dhogaza(at)pacifier(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Functions returning sets
Date: 2001-05-20 18:55:02
Message-ID: Pine.BSF.4.21.0105201144170.54047-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sun, 20 May 2001, Don Baccus wrote:

> At 10:55 AM 5/20/01 -0700, Stephan Szabo wrote:
> > Can the IN always get written as a
> >join and is it always better to do so?
>
> Nope:
> ...
> A better question, I guess, is if it is always better to write
> it as a join if the left hand operand is a table column and
> the right hand operand a rowset.

Well I was assuming we were talking about the subquery case
in general :)

It might be a problem with subqueries with set value functions
and parameters passed down from the outer tables:
select * from blah where
blah.val1 in
(select count(*) from blah2 where blah2.val2=blah.val2
group by blah2.val3);

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Raoul Callaghan 2001-05-20 19:31:04 "select for update" question....
Previous Message Don Baccus 2001-05-20 18:29:00 Re: Functions returning sets