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

Query: optimize CASE blocks #19295

Closed
maumar opened this issue Dec 12, 2019 · 0 comments · Fixed by #19548
Closed

Query: optimize CASE blocks #19295

maumar opened this issue Dec 12, 2019 · 0 comments · Fixed by #19548
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@maumar
Copy link
Contributor

maumar commented Dec 12, 2019

  • If one of the conditions in CaseWhen test evaluates to false we can remove it
  • If one of the conditions in CaseWhen test evaluates to true, we can remove all blocks (including else block) that appears after
  • If we only have one CaseWhen block in the end, and test evaluates to true, we can simply return the result
  • If only Else block is left, return it's result
  • if nothing is left, return NULL
@maumar maumar self-assigned this Dec 12, 2019
@ajcvickers ajcvickers added this to the 5.0.0 milestone Dec 13, 2019
maumar added a commit that referenced this issue Jan 9, 2020
- if one of the conditions in CaseWhen test evaluates to false we can remove it,
- if one of the conditions in CaseWhen test evaluates to true, we can remove all blocks (including else block) that appears after,
- if we only have one CaseWhen block in the end, and test evaluates to true, we can simply return the result,
- if only Else block is left, return it's result,
- if nothing is left, return NULL.

Resolves #19295
@maumar maumar added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jan 9, 2020
maumar added a commit that referenced this issue Jan 9, 2020
- if one of the conditions in CaseWhen test evaluates to false we can remove it,
- if one of the conditions in CaseWhen test evaluates to true, we can remove all blocks (including else block) that appears after,
- if we only have one CaseWhen block in the end, and test evaluates to true, we can simply return the result,
- if only Else block is left, return it's result,
- if nothing is left, return NULL.

Resolves #19295
@maumar maumar closed this as completed in 194b164 Jan 15, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview1 Mar 13, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview1, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants