Use a nested select. Do the function in the inner select and the where and
group by in the outer select.

On Saturday, 4 April 2015, Harshad RJ <[email protected]> wrote:

>
> On Sun, Apr 5, 2015 at 12:54 AM, Noel Grandin <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> If you declare the function as deterministic we have a small cache of
>> input-to-output values for each user function.
>>
>
> ​Ah yes; that would explain it. Moreover, if the WHERE clause ​evaluates
> to false, some rows would get eliminated, avoiding the duplicate evaluation
> in the SELECT column list.
>
> I think the summary of this thread is a feature request: if possible,
> please implement Common Sub-expression Elimination in H2.
>
> ​I sent too many emails before understanding the root cause; I am sorry
> for the noise.​
>
> --
> *Harshad RJ <http://lavadip.com>*
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to