Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: avoid pulling up subquerys that contain volatile functions?


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Jaime Casanova <systemguards(at)gmail(dot)com>
  • Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
  • Subject: Re: avoid pulling up subquerys that contain volatile functions?
  • Date: Sun, 09 Oct 2005 12:24:29 -0400
  • Message-id: <6755.1128875069@sss.pgh.pa.us> <text/plain>

Jaime Casanova <systemguards(at)gmail(dot)com> writes:
> On 10/8/05, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> This is exactly the same example discussed in previous threads on this
>> issue.  Do you think it will change anyone's mind?

> in any case, i still think that is better to get bad performance
> because i forgot to correctly mark a function that to get incorrect
> data from a correct query because a "gotcha"... there is a precedent
> for this in postgres???

Just to be clear, I'm in favor of changing it; but the majority opinion
in the previous discussion seemed to be against.

> ... but i don't understand why when i add the function
> contain_volatile_functions in the is_simple_subquery function i got
> the same results... :)

You should only be enforcing the restriction against the subquery's
target list anyway.  The expression_returns_set test is the model to
follow.  BTW, you'll also need to make some fixes in allpaths.c, else
you'll still get bit by qual pushdown; again, look for
expression_returns_set.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group