Skip to content

[enhancement](Nereids)merge consecutive LogicalLimit plan#12096

Merged
morrySnow merged 2 commits intoapache:masterfrom
englefly:merge_limit
Aug 26, 2022
Merged

[enhancement](Nereids)merge consecutive LogicalLimit plan#12096
morrySnow merged 2 commits intoapache:masterfrom
englefly:merge_limit

Conversation

@englefly
Copy link
Copy Markdown
Contributor

@englefly englefly commented Aug 26, 2022

Proposed changes

This rule aims to merge consecutive limits.

LogicalLimit(limit=10, offset=4)
+---LogicalLimit(limit=3, offset=5)

transformed to

LogicalLimit(limit=3, offset=5)

where

newLimit = min(topLimit.limit, bottomLimit.limit)
newLimit.offset = bottomLimit.offset
topLimit.offset is ignored

Problem summary

Describe your changes.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

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...

@englefly
Copy link
Copy Markdown
Contributor Author

@moonming review, please

@morrySnow morrySnow changed the title merge consecutive limits [enhancement](Nereids)merge consecutive LogicalLimit plan Aug 26, 2022
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Aug 26, 2022
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 4636d6c into apache:master Aug 26, 2022
GoGoWen pushed a commit to GoGoWen/incubator-doris that referenced this pull request Aug 31, 2022
This rule aims to merge consecutive limits.

LogicalLimit(limit=10, offset=4)
+---LogicalLimit(limit=3, offset=5)

transformed to

LogicalLimit(limit=3, offset=5)

where

newLimit.limit    = min(topLimit.limit, bottomLimit.limit)
newLimit.offset = bottomLimit.offset
topLimit.offset  is ignored
@englefly englefly deleted the merge_limit branch December 3, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/nereids reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants