You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Extend single-value NDV optimization to timestamp and interval types #21111
Is your feature request related to a problem or challenge?
In #21077, we set distinct_count to Exact(1) when a filter predicate collapses a column interval to a single value. This works for numeric types (Int8, Int16, Int32, Int64, UInt32, Float32, Float64) but not for temporal types (Timestamp, Interval, Duration).
Despite next_value_helper() having implementations for these types, the constraint propagation solver does not collapse equality predicates on temporal columns to single-value intervals.
For example, WHERE ts = '2021-01-01T00:00:00' should produce NDV=Exact(1) but currently stays at the original Inexact NDV.
Describe the solution you'd like
Investigate why interval analysis does not collapse temporal equality predicates despite next_value support, and fix the root cause. Alternatively, detect equality predicates directly in collect_new_statistics, bypassing interval analysis for the NDV computation.
Describe alternatives you've considered
The direct equality detection approach proposed in #21109 (for strings) could also cover temporal types in one pass.
Activity
buraksenn commentedon Mar 23, 2026
take
feat: extend interval analysis support for temporal types (#21520)
feat: extend interval analysis support for temporal types (apache#21520)