opt: drop provably-non-null COALESCE operands#170858
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
Friendly ping for review when you have time. Fixes #103596 — implements Test plan (run locally): bazel test //pkg/sql/opt/norm:norm_test --test_filter=TestNormRules@mgartner — you outlined the approach on the issue; would appreciate your eyes on the norm rules / testdata if you have bandwidth. @mw5h — thanks if you're already on this via code owners. Happy to iterate on any feedback. If full CI needs a maintainer trigger for community PRs, please let me know what to run. |
|
Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link) |
|
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
When a leading COALESCE argument is known non-null from the input's NotNullCols, later arguments aren't needed. Starting with Project and Select since scalar rules don't have relational props. Fixes cockroachdb#103596 Release note: None
96f43bf to
164d43d
Compare
|
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Fixes #103596
Uses
NotNullColsto trim leadingCOALESCEargs in Project and Select. Example:SELECT COALESCE(i, j) FROM ijwithi NOT NULLno longer keeps the coalesce in the plan.Test plan:
bazel test //pkg/sql/opt/norm:norm_test --test_filter=TestNormRules