Deterministic function optimization works only for constant arguments. But 
there is a case when similar optimization can be applied as well.

In sql query example below, heavy "datediff" function will be called 4 
times per row.
I'd expected deterministic functions (like "datediff") was called once per 
row and the result was reused in aggregate functions.

Select
  avg(datediff('s',field1,field2)) as avg_diff,
  min(datediff('s',field1,field2)) as min_diff,
  max(datediff('s',field1,field2)) as max_diff
>From table



-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to