[Enhancement]: Support chunk skipping when one or more chunks have NULL values on the column for which skipping is enabled #7484
Labels
enhancement
An enhancement to an existing feature for functionality
What type of enhancement is this?
API improvement
What subsystems and features will be improved?
Chunk skipping
What does the enhancement do?
Example use case: A hypertable H can have a new integer column C added at some point in time with only the newer data having values for C. This will mean that the older rows in H will have a NULL value in C.
Existing behaviour (v2.17.1) - Enabling chunk skipping on C, and calling
compress_chunk(show_chunks(H))
, results in the default value ofrange_start
andrange_end
in_timescaledb_catalog.chunk_column_stats
for the older chunks (with NULL values) to be the full range of the integer variable spanning(-9223372036854775808, 9223372036854775807)
This means the these chunks will always be included in the query and effectively means that there is no benefit of enabling chunk skipping on C
Suggested improvement - In the broader goal to make chunk skipping work when all rows in one or more chunks have default values or NULLs, suggest to use a different default value for
range_start
andrange_end
, or even have it possible to be defined by the user who potentially knows the range of values that their data will spanAlso, happy to work on this myself if this is accepted
The text was updated successfully, but these errors were encountered: