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

From Martijn van Oosterhout
Subject Re: Using IN with subselect
Date
Msg-id 20041125172542.GC28393@svana.org
Whole thread Raw
In response to Re: Using IN with subselect  (Dave Smith <dave.smith@candata.com>)
List pgsql-general
On Thu, Nov 25, 2004 at 12:19:23PM -0500, Dave Smith wrote:
> Well here is explain. I would guess that it is executed each time ..
> function any different?

Hmm, if it's only executed once I would expect it to be an InitPlan.
Are you sure it's not correlated?

If you want to make sure, put the subquery in the FROM clause, that it
definitly will only be run once.

<snip>

Hope this helps,
--
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: "Julian Scarfe"
Date:
Subject: How can I change a cast from explicit only to implicit?
Next
From: Tom Lane
Date:
Subject: Re: Using IN with subselect