cockroachdb / cockroachdb/cockroach

opt: lift restrictions on comparison normalizations

Open
#118,475 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

See: #118307

In #118307 we lifted the restrictions on types of comparison normalization rules. I think it should be possible to lift this restriction for more types. For each pair of types allowed in `l - r` and l + r` expressions, we should determine if an overflow will error. If overflows cause errors, then we can apply the normalization rules to those types.

Overloads for `-` can be found here:https://github.com/cockroachdb/cockroach/blob/58ec968722bab80da5dcb681fd3f066a39ff518e/pkg/sql/sem/tree/eval.go#L770

Overloads for `+` can be found here: https://github.com/cockroachdb/cockroach/blob/58ec968722bab80da5dcb681fd3f066a39ff518e/pkg/sql/sem/tree/eval.go#L599

Jira issue: CRDB-35754

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.