You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Steshin (Jira)" <ji...@apache.org> on 2022/05/18 13:57:00 UTC

[jira] [Commented] (IGNITE-16920) Calcite Engine. COUNT() lacks optimization.

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

Vladimir Steshin commented on IGNITE-16920:
-------------------------------------------

Calcite doesn't use index, counting records in metapages like H2. 

What H2 does:
{code:java}
H2TreeIndex:: getRowCount()

public long InlineIndexImpl::count(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException {
        return segments[segment].size(filterClosure(qryCtx));
}

metaPage -> records number
{code}


Calcite:
IgniteReduceHashAggregate(group=[{}], COUNT(*)=[COUNT()])
  IgniteExchange(distribution=[single])
    IgniteMapHashAggregate(group=[{}], COUNT(*)=[COUNT()])
      IgniteTableScan(table=[[PUBLIC, PI_COM_DAY]])


> Calcite Engine. COUNT() lacks optimization.
> -------------------------------------------
>
>                 Key: IGNITE-16920
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16920
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>    Affects Versions: 2.13
>            Reporter: YuJue Li
>            Priority: Major
>              Labels: calcite2-required, calcite3-required
>             Fix For: 2.14
>
>         Attachments: PI_COM_DAY.sql, example-calcite.xml, image-2022-05-01-13-35-59-275.png
>
>
> !image-2022-05-01-13-35-59-275.png!



--
This message was sent by Atlassian Jira
(v8.20.7#820007)