Re: [PATCH] Negative Transition Aggregate Functions (WIP) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Date
Msg-id 11808.1387196329@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Negative Transition Aggregate Functions (WIP)  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: [PATCH] Negative Transition Aggregate Functions (WIP)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
>> One thing that is currently on my mind is what to do when passing volatile
>> functions to the aggregate. Since the number of times we execute a volatile
>> function will much depend on the window frame options, I think we should
>> include some sort of warning in the documentation that "The number of times
>> that the expression is evaluated within the aggregate function when used in
>> the context of a WINDOW is undefined". The other option would be to disable
>> this optimisation if the aggregate expression contained a volatile
>> function, but doing this, to me seems a bit weird as is anyone actually
>> going to be depending on a volatile function being executed so many times?

Once again: this patch has no business changing any user-visible behavior.
That would include not changing the number of evaluations of volatile
functions.  The planner is full of places where optimizations are disabled
for volatile subexpressions, and I don't see why this should be different.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: GIN improvements part 1: additional information
Next
From: "MauMau"
Date:
Subject: Re: [9.3 bug] disk space in pg_xlog increases during archive recovery