[Bug]: timescaledb.enable_columnarscan = off silently returns zero rows from columnstore chunks
What type of bug is this?
Incorrect result
What subsystems and features are affected?
Compression (hypercore / columnstore), Query planner
What happened?
With timescaledb.enable_columnarscan = off, queries against a chunk that has been converted to the columnstore return zero rows, silently. No error, no warning — just an empty result where the data plainly exists.
The same query returns the correct rows with the GUC at its default of on, and the rows are still there (turning the GUC back on, or decompressing the chunk, brings them back). So this is lost data at read time, not lost data at write time.
I found this while looking for a way to work around #10655 and nearly adopted it as the workaround before I thought to check the row counts rather than just whether the statement succeeded. A setting that makes a crash go away by returning nothing is a nasty trap, which is why I am reporting it separately.
How can we reproduce the bug?
Any columnstore chunk seems to do — unlike the crash in #10655, this one does not appear to need any particular data. Setup:
CREATE TABLE m (
"time" TIMESTAMPTZ NOT NULL,
connector TEXT, context TEXT, path TEXT,
value JSONB, uuid UUID, type TEXT, origin TEXT, transfer_uuid UUID
);
SELECT create_hypertable('m','time', chunk_time_interval => INTERVAL '7 days');
-- load rows spanning a couple of hours
CREATE UNIQUE INDEX m_u ON m ("time",origin,context,path,connector);
ALTER TABLE m SET (
timescaledb.enable_columnstore,
timescaledb.segmentby = 'origin',
timescaledb.orderby = 'time DESC'
);Count the window before compressing, to establish ground truth:
SELECT count(*) FROM m
WHERE "time" >= '2026-08-14 01:00:00+00' AND "time" < '2026-08-14 01:05:00+00';
-- 15520Then compress and repeat with the GUC off:
CALL convert_to_columnstore('<the chunk>');
SELECT count(*) FROM m WHERE "time" >= '...' AND "time" < '...';
-- 15520 -- default, correct
SET timescaledb.enable_columnarscan = off;
SELECT count(*) FROM m WHERE "time" >= '...' AND "time" < '...';
-- 0 -- wrong, and no errorMeasured on my fixture, ground truth 15520 rows:
| setting | SELECT count(*) |
CREATE TABLE t AS SELECT * |
|---|---|---|
| default | 15520 ✓ | segfault (see #10655) |
enable_bulk_decompression = off |
15520 ✓ | 15520 ✓ |
enable_columnarscan = off |
0 ✗ | 0 ✗ |
I would expect disabling the only scan node that can read columnstore data to either fall back to something that can, or raise an error — not to quietly report that the chunk is empty.
TimescaleDB version affected
2.30.1 (also present in 2.27.1)
PostgreSQL version used
17.11
What operating system did you use?
NixOS, x86_64
What installation method did you use?
Other (Nix package, postgresql_17.withPackages (ps: [ ps.timescaledb ]))
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
(no log output — the query succeeds and returns an empty result)Source: timescale/timescaledb