@@ -31,10 +31,11 @@ select count(compress_chunk(x)) from show_chunks('bloom') x;
3131select * from settings;
3232vacuum full analyze bloom;
3333
34- select schema_name || '.' || table_name chunk from _timescaledb_catalog.chunk
35- where id = (select compressed_chunk_id from _timescaledb_catalog.chunk
36- where hypertable_id = (select id from _timescaledb_catalog.hypertable
37- where table_name = 'bloom') limit 1)
34+ select cs.compress_relid::regclass chunk from _timescaledb_catalog.chunk ch
35+ join _timescaledb_catalog.compression_settings cs
36+ on cs.relid = format('%I.%I', ch.schema_name, ch.table_name)::regclass
37+ where ch.hypertable_id = (select id from _timescaledb_catalog.hypertable
38+ where table_name = 'bloom') limit 1
3839\gset
3940
4041select * from test.show_columns_ext(:'chunk'::regclass);
@@ -288,10 +289,11 @@ select count(compress_chunk(x)) from show_chunks('badtable') x;
288289
289290vacuum full analyze badtable;
290291
291- select schema_name || '.' || table_name chunk from _timescaledb_catalog.chunk
292- where id = (select compressed_chunk_id from _timescaledb_catalog.chunk
293- where hypertable_id = (select id from _timescaledb_catalog.hypertable
294- where table_name = 'badtable') limit 1)
292+ select cs.compress_relid::regclass chunk from _timescaledb_catalog.chunk ch
293+ join _timescaledb_catalog.compression_settings cs
294+ on cs.relid = format('%I.%I', ch.schema_name, ch.table_name)::regclass
295+ where ch.hypertable_id = (select id from _timescaledb_catalog.hypertable
296+ where table_name = 'badtable') limit 1
295297\gset
296298
297299select * from test.show_columns_ext(:'chunk'::regclass);
@@ -324,10 +326,11 @@ select * from settings;
324326vacuum full analyze badtable;
325327
326328-- Verify that we actually got the bloom filter index.
327- select schema_name || '.' || table_name chunk from _timescaledb_catalog.chunk
328- where id = (select compressed_chunk_id from _timescaledb_catalog.chunk
329- where hypertable_id = (select id from _timescaledb_catalog.hypertable
330- where table_name = 'badtable') limit 1)
329+ select cs.compress_relid::regclass chunk from _timescaledb_catalog.chunk ch
330+ join _timescaledb_catalog.compression_settings cs
331+ on cs.relid = format('%I.%I', ch.schema_name, ch.table_name)::regclass
332+ where ch.hypertable_id = (select id from _timescaledb_catalog.hypertable
333+ where table_name = 'badtable') limit 1
331334\gset
332335
333336select * from test.show_columns_ext(:'chunk'::regclass);
0 commit comments