Summary
Add stats rewrite rules that can falsify simple LIKE predicates using ordered string bounds, such as exact strings and anchored prefixes.
Context
While porting existing stats pruning behavior to the aggregate-backed stats rewrite registry, we found a LIKE rewrite that would be new behavior relative to develop. That should be handled separately from the current stats rewrite migration epic.
Possible approach
- Support non-negated, case-sensitive LIKE patterns that are either exact strings or anchored prefixes.
- Rewrite them against min/max or bounded-min/bounded-max string stats.
- Keep suffix, contains, case-insensitive, and escaped-pattern behavior out of scope until the semantics are specified and tested.
Testing
Add expression rewrite tests and zoned-layout pruning tests showing that true rewrite results only prove the original LIKE predicate is false for the zone.
Summary
Add stats rewrite rules that can falsify simple LIKE predicates using ordered string bounds, such as exact strings and anchored prefixes.
Context
While porting existing stats pruning behavior to the aggregate-backed stats rewrite registry, we found a LIKE rewrite that would be new behavior relative to develop. That should be handled separately from the current stats rewrite migration epic.
Possible approach
Testing
Add expression rewrite tests and zoned-layout pruning tests showing that true rewrite results only prove the original LIKE predicate is false for the zone.