Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ts_catalog/chunk_column_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef struct ChunkRangeSpace
} ChunkRangeSpace;

#define CHUNKRANGESPACE_SIZE(num_columns) \
(sizeof(ChunkRangeSpace) + (sizeof(NameData) * (num_columns)))
(sizeof(ChunkRangeSpace) + (sizeof(FormData_chunk_column_stats) * (num_columns)))

extern ChunkRangeSpace *ts_chunk_column_stats_range_space_scan(int32 hypertable_id, Oid ht_reloid,
MemoryContext mctx);
Expand Down
14 changes: 14 additions & 0 deletions tsl/test/expected/chunk_column_stats.out
Original file line number Diff line number Diff line change
Expand Up @@ -775,3 +775,17 @@ SELECT * FROM attno WHERE id = 1 AND start > '2025-02-02T11:53:28Z'::date ORDER
1 | Thu Jan 01 00:01:00 2026 PST
1 | Thu Jan 01 00:06:00 2026 PST

-- Test for wrong allocation size of chunk stats storage
CREATE TABLE sensor_readings(measured_at timestamptz NOT NULL, temperature int, humidity int);
SELECT create_hypertable('sensor_readings', 'measured_at');
create_hypertable
-------------------------------
(10,public,sensor_readings,t)

SELECT enable_chunk_skipping('sensor_readings', 'temperature');
enable_chunk_skipping
-----------------------
(17,t)

RESET timescaledb.enable_chunk_skipping;
RESET timescaledb.enable_chunk_skipping;
9 changes: 9 additions & 0 deletions tsl/test/sql/chunk_column_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,12 @@ SELECT count(compress_chunk(ch)) FROM show_chunks('attno') ch;

SELECT * FROM attno WHERE id = 1 AND start > '2025-02-02T11:53:28Z'::date ORDER BY start;


-- Test for wrong allocation size of chunk stats storage
CREATE TABLE sensor_readings(measured_at timestamptz NOT NULL, temperature int, humidity int);
SELECT create_hypertable('sensor_readings', 'measured_at');
SELECT enable_chunk_skipping('sensor_readings', 'temperature');
RESET timescaledb.enable_chunk_skipping;


RESET timescaledb.enable_chunk_skipping;
Loading