Re: Using IN with subselect - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Using IN with subselect
Date
Msg-id 20041125171111.GB28393@svana.org
Whole thread Raw
In response to Using IN with subselect  (Dave Smith <dave.smith@candata.com>)
Responses Re: Using IN with subselect
List pgsql-general
Running EXPLAIN over the query will tell you...

On Thu, Nov 25, 2004 at 11:49:06AM -0500, Dave Smith wrote:
> I have a query with an in subquery like
>
> where x in (select x from y);
>
> Now the subquery is not related to the outer query so it always returns
> the same set. Is this subselect executed each time or just once? If it
> is executed each time, if I create a function would that then be only
> executed once?
>
> --
> Dave Smith
> CANdata Systems Ltd
> 416-493-9020
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: why use SCHEMA? any real-world examples?
Next
From: Dave Smith
Date:
Subject: Re: Using IN with subselect