You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2022/09/27 11:59:00 UTC

[jira] [Commented] (IGNITE-17250) Calcite. Make 'min()/max()' use first/last index value.

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

Evgeny Stanilovsky commented on IGNITE-17250:
---------------------------------------------

don`t forget about ordering)

> Calcite. Make 'min()/max()' use first/last index value.
> -------------------------------------------------------
>
>                 Key: IGNITE-17250
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17250
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Vladimir Steshin
>            Assignee: Vladimir Steshin
>            Priority: Major
>              Labels: ise
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Currently, Calcite's plan on min()/max() is the table scan and the aggregation n the indexed field:
> {code:sql}
> "select min(salary) from Person"
> {code}
> Plan:
> {code:java}
> IgniteReduceHashAggregate(group=[{}], MAX(SALARY)=[MAX($0)])
>   IgniteExchange(distribution=[single])
>     IgniteMapHashAggregate(group=[{}], MAX(SALARY)=[MAX($0)])
>       IgniteTableScan(table=[[PUBLIC, PERSON]], requiredColumns=[{3}])
> {code}
> We could pick up first index record. No need to scan.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)