[ 
https://issues.apache.org/jira/browse/IGNITE-4035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15548806#comment-15548806
 ] 

Andrew Mashenkov edited comment on IGNITE-4035 at 10/11/16 9:02 AM:
--------------------------------------------------------------------

I've noticed we have some cache (h2ObjToGridObj) in GridSqlQueryParser, but it 
seems to be useless. I have no cache hit running query above.



was (Author: amashenkov):
I've noticed we have some cache (h2ObjToGridObj) in GridSqlQueryParser, but it 
was useless for me. I have no cache hit running query above.

GridSqlQueryParser use IdentityHashMap for Expression objects. And Expression 
objects do not realize equality contract. So we fully rely on H2 query 
optimizer. 
It wiil be nice to have a workaround here.

> SQL: Avoid excessive calls of deterministic functions on same arguments
> -----------------------------------------------------------------------
>
>                 Key: IGNITE-4035
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4035
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 1.6, 1.7
>            Reporter: Andrew Mashenkov
>              Labels: performance
>
> In sql query example below, heavy "datediff" deterministic function will be 
> called 4 times per row. I'd expected function was called once per row. 
> Example:
> {noformat}
> Select
>   avg(datediff('s',ts1,ts2)) as avg_diff,
>   min(datediff('s',ts1,ts2)) as min_diff,
>   max(datediff('s',ts1,ts2)) as max_diff
> From table
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to