[FE] Prune InPredicate bound to distribution column.#6031
Closed
killxdcj wants to merge 1 commit intoapache:masterfrom
Closed
[FE] Prune InPredicate bound to distribution column.#6031killxdcj wants to merge 1 commit intoapache:masterfrom
killxdcj wants to merge 1 commit intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 isk1, bucket num is 2.tablet_0contains data withk1 in (0, 2),tablet_1contains data withk1 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_0andscan_node_1are responsible for scanningtablet_0andtablet_1respectively. Then each sacn_node's conjuncts arek1 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_0tok1 in (0, 2)and the InPredicate of thescan_node_1tok1 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
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...