You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Chinna Rao Lalam (Jira)" <ji...@apache.org> on 2026/09/09 05:44:00 UTC
[jira] [Assigned] (HIVE-28814) Optimize count(*) queries on Iceberg tables
[ https://issues.apache.org/jira/browse/HIVE-28814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chinna Rao Lalam reassigned HIVE-28814:
---------------------------------------
Assignee: Chinna Rao Lalam
> Optimize count(*) queries on Iceberg tables
> -------------------------------------------
>
> Key: HIVE-28814
> URL: https://issues.apache.org/jira/browse/HIVE-28814
> Project: Hive
> Issue Type: Improvement
> Components: Iceberg integration, Statistics
> Affects Versions: 4.0.1
> Reporter: Denys Kuzmenko
> Assignee: Chinna Rao Lalam
> Priority: Major
>
> Simple {{SELECT count( * ) FROM tbl_ice;}} could be optimized.
> 1. If a V2 table doesn't have any delete files, then the cardinality is
> {noformat}
> Cardinality(data files){noformat}
> 2. If the above is not true, we can still optimize count( * ) queries by:
> {noformat}
> SUM
> |
> UNION ALL
> / \
> / \
> / \
> COUNT(*) COUNT(*)
> / \
> SCAN ANTI JOIN
> data files / \
> without / \
> deletes SCAN SCAN
> data files delete files
> with deletes
> {noformat}
> The SCAN operator with "data files without deletes" could benefit from count( * ) optimization (they would only need to read file metadata). In the common case (when there are few deletes) this SCAN is in charge of scanning the vast majority of data files.
> ref: [https://issues.apache.org/jira/browse/IMPALA-11802]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)