Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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