Re: Handling of mutable functions in subqueries?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Handling of mutable functions in subqueries?
Date: 2004-10-01 19:09:12
Message-ID: 13675.1096657752@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Shouldn't Postgres be noticing the non-immutable random() function and not
> making the subquery an InitPlan?

Perhaps. In the dim past, using a dummy subquery was the only way to
persuade the planner not to re-evaluate functions that you didn't want
evaluated more than once, so changing this could be expected to break
some existing applications. Barring some non-invented cases where it
causes problems, I'm inclined to leave it alone.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-10-01 19:34:38 ERROR: left link changed unexpectedly
Previous Message Darcy Buskermolen 2004-10-01 18:52:58 Re: AIX and V8 beta 3