zhangstar333 opened a new pull request, #59123:
URL: https://github.com/apache/doris/pull/59123
### What problem does this PR solve?
iceberg table maybe could have column statistics, so if like agg of
min/max(col)
no need to scan all data files.
```
| 0:VICEBERG_SCAN_NODE(129)
|
| table:
test_iceberg_optimize_min_max_catalog.format_v2.sample_mor_parquet |
| inputSplitNum=41, totalFileSize=283273, scanRanges=41
|
| partition=0/0
|
| cardinality=1000, numNodes=1
|
| pushdown agg=MINMAX
|
| MINMAX: opt/total_splits(32/41)
|
| final projections: id[#0]
|
| final project output tuple id: 1
|
|
|
|
|
|
|
| ========== STATISTICS ==========
|
| planned with unknown column statistics
|
+--------------------------------------------------------------------------------+
52 rows in set (0.05 sec)
mysql> select count() from
test_iceberg_optimize_min_max_catalog.format_v2.sample_mor_parquet$delete_files;
+---------+
| count() |
+---------+
| 9 |
+---------+
1 row in set (0.07 sec)
```
```
10000000 rows in table
mysql> set enable_iceberg_min_max_optimization = false;
Query OK, 0 rows affected (0.01 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.18 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.18 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.18 sec)
mysql> set enable_iceberg_min_max_optimization = true;
Query OK, 0 rows affected (0.00 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.06 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.05 sec)
mysql> select min(sales_id) from t_sales_record;
+---------------+
| min(sales_id) |
+---------------+
| 7001 |
+---------------+
1 row in set (0.05 sec)
```
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]