Skip to content

[FE] Prune InPredicate bound to distribution column.#6031

Closed
killxdcj wants to merge 1 commit intoapache:masterfrom
killxdcj:feature_prune_conjuncts_bound_to_distribution_column
Closed

[FE] Prune InPredicate bound to distribution column.#6031
killxdcj wants to merge 1 commit intoapache:masterfrom
killxdcj:feature_prune_conjuncts_bound_to_distribution_column

Conversation

@killxdcj
Copy link
Contributor

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)
  • 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
  • I have added tests that prove my fix is effective or that my feature works
  • 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 dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant