killxdcj opened a new pull request #6031: URL: https://github.com/apache/incubator-doris/pull/6031
## Proposed changes Prune OlapScanNode's conjuncts according the tablets to be scanned, it only support prune InPredicate. ### Details Suppose there is a table named `table_a`, `table_a`'s distribution column is `k1`, bucket num is 2. `tablet_0` contains data with `k1 in (0, 2)`, `tablet_1` contains data with `k1 in (1, 3)`. when executing the following query: `select * from table_a where k1 in (0, 1, 2, 3)`. Suppose there are two OlapScanNode in the execution plan, `scan_node_0` and `scan_node_1` are responsible for scanning `tablet_0` and `tablet_1` respectively. Then each sacn_node's conjuncts are `k1 in (0, 1, 2, 3)`. However, considering the situation of the tablets scanned by OlapScanNode, it is actually possible to prune the InPredicate of the `scan_node_0` to `k1 in (0, 2)` and the InPredicate of the `scan_node_1` to `k1 in (1, 3)`. By prune InPredicate, we can reduce the number of ScanKeys in OlapScanNode and improve the performance of data scanning, especially when InPredicate contains a large number of elements. ## Types of changes - [ ] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation Update (if none of the other choices apply) - [ ] Code refactor (Modify the code structure, format the code, etc...) ## Checklist - [ ] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail - [ ] Compiling and unit tests pass locally with my changes - [x] I have added tests that prove my fix is effective or that my feature works - [x] If these changes need document changes, I have updated the document - [ ] Any dependent changes have been merged ## Further comments If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc... -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
