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: improve null semantics around bitwise operators #18500

Closed
maumar opened this issue Oct 22, 2019 · 2 comments
Closed

Query: improve null semantics around bitwise operators #18500

maumar opened this issue Oct 22, 2019 · 2 comments
Assignees

Comments

@maumar
Copy link
Contributor

maumar commented Oct 22, 2019

Queries that use flags enums, passed as parameters will be expanded to:

(column | flagPrm) = flagPrm

which then is translated to:

((column | flagPrm) = flagPrm) AND ((column | flagPrm) IS NOT NULL AND flagPrm IS NOT NULL

this is because at the time of translation we don't know if flagPrm is null or not. Once we peek into the parameter values we can easily optimize out the flagPrm IS NOT NULL term, but unnecessary bitwise part persists.

We should break it down into components, i.e. (a | b) IS NULL <=> a IS NULL OR b IS NULL (same goes for (a & b)

@maumar maumar self-assigned this Oct 22, 2019
@maumar maumar added this to the 3.1.0 milestone Oct 22, 2019
@maumar
Copy link
Contributor Author

maumar commented Oct 22, 2019

general case: #16078

@maumar
Copy link
Contributor Author

maumar commented Oct 24, 2019

closing in favor of #16078

@maumar maumar closed this as completed Oct 24, 2019
@maumar maumar removed this from the 3.1.0 milestone Oct 24, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants