Michael Taranov
12/16/2025, 1:21 PMЕвгений Шишкин
12/16/2025, 2:39 PMMichael Taranov
12/16/2025, 5:07 PMЕвгений Шишкин
12/16/2025, 5:07 PMЕвгений Шишкин
12/18/2025, 9:33 PMmysql> show variables like 'enable_rewrite_%';
+-------------------------------------------+-------+
| Variable_name | Value |
+-------------------------------------------+-------+
| enable_rewrite_bitmap_union_to_bitamp_agg | true |
| enable_rewrite_groupingsets_to_union_all | false |
| enable_rewrite_or_to_union_all_join | false |
| enable_rewrite_partition_column_minmax | true |
| enable_rewrite_simple_agg_to_hdfs_scan | false |
| enable_rewrite_simple_agg_to_meta_scan | false |
| enable_rewrite_sum_by_associative_rule | true |
| enable_rewrite_unnest_bitmap_to_array | true |
+-------------------------------------------+-------+
8 rows in set (0.00 sec)
mysql> set enable_rewrite_simple_agg_to_hdfs_scan = true;
Query OK, 0 rows affected (0.01 sec)
mysql> set enable_rewrite_simple_agg_to_meta_scan = true;
Query OK, 0 rows affected (0.00 sec)
explain select count(*) from iceberg.xxx.transactions;
+----------------------------------------------------+
| Explain String |
+----------------------------------------------------+
| PLAN FRAGMENT 0 |
| OUTPUT EXPRS:52: count |
| PARTITION: UNPARTITIONED |
| |
| RESULT SINK |
| |
| 4:Project |
| | <slot 52> : ifnull(55: sum_count, 0) |
| | |
| 3:AGGREGATE (merge finalize) |
| | output: sum(55: sum_count) |
| | group by: |
| | |
| 2:EXCHANGE |
| |
| PLAN FRAGMENT 1 |
| OUTPUT EXPRS: |
| PARTITION: RANDOM |
| |
| STREAM DATA SINK |
| EXCHANGE ID: 02 |
| UNPARTITIONED |
| |
| 1:AGGREGATE (update serialize) |
| | output: sum(56: ___count___) |
| | group by: |
| | |
| 0:IcebergScanNode |
| TABLE: xxx.transactions |
| TABLE VERSION: Snapshot@(7808551201887433419) |
| cardinality=1 |
| avgRowSize=1.0 |
+----------------------------------------------------+
output: sum(56: ___count___) is what tells it uses meta scanЕвгений Шишкин
12/18/2025, 9:36 PMЕвгений Шишкин
12/19/2025, 8:27 PMMichael Taranov
12/21/2025, 7:26 AMSELECT
/*+ SET_VAR(
enable_rewrite_simple_agg_to_hdfs_scan=true,
enable_rewrite_simple_agg_to_meta_scan = true)
*/
min(ts), max(ts)
FROM our_schema.table;
Attaching query profileMichael Taranov
12/21/2025, 7:33 AMMichael Taranov
12/23/2025, 1:57 PMЕвгений Шишкин
12/23/2025, 2:07 PMЕвгений Шишкин
12/26/2025, 9:48 PM