Rename compression TAM to hyperstore

The access method and associated tests is renamed to "hyperstore".
This commit is contained in:
Mats Kindahl 2024-02-09 16:58:16 +01:00 committed by Mats Kindahl
parent 89ded283e6
commit 1373ec31f8
9 changed files with 22 additions and 22 deletions

View File

@ -5,5 +5,5 @@
CREATE FUNCTION ts_compressionam_handler(internal) RETURNS table_am_handler
AS '@MODULE_PATHNAME@', 'ts_compressionam_handler' LANGUAGE C;
CREATE ACCESS METHOD tscompression TYPE TABLE HANDLER ts_compressionam_handler;
COMMENT ON ACCESS METHOD tscompression IS 'TimescaleDB columnar compression';
CREATE ACCESS METHOD hyperstore TYPE TABLE HANDLER ts_compressionam_handler;
COMMENT ON ACCESS METHOD hyperstore IS 'TimescaleDB columnar compression';

View File

@ -1,3 +1,3 @@
-- Hyperstore AM
DROP ACCESS METHOD IF EXISTS tscompression;
DROP ACCESS METHOD IF EXISTS hyperstore;
DROP FUNCTION IF EXISTS ts_compressionam_handler;

View File

@ -1803,7 +1803,7 @@ bool
ts_is_hypercore_am(Oid amoid)
{
if (!OidIsValid(hypercore_amoid))
hypercore_amoid = get_table_am_oid("tscompression", true);
hypercore_amoid = get_table_am_oid("hyperstore", true);
if (!OidIsValid(amoid) || !OidIsValid(hypercore_amoid))
return false;

View File

@ -40,7 +40,7 @@ tsl_ddl_command_start(ProcessUtilityArgs *args)
case AT_SetAccessMethod:
{
Oid relid = AlterTableLookupRelation(stmt, NoLock);
bool to_compressionam = (strcmp(cmd->name, "tscompression") == 0);
bool to_compressionam = (strcmp(cmd->name, "hyperstore") == 0);
if (to_compressionam)
compressionam_alter_access_method_begin(relid, false);
@ -204,7 +204,7 @@ tsl_ddl_command_end(EventTriggerData *command)
case AT_SetAccessMethod:
{
Oid relid = AlterTableLookupRelation(stmt, NoLock);
bool to_compressionam = (strcmp(cmd->name, "tscompression") == 0);
bool to_compressionam = (strcmp(cmd->name, "hyperstore") == 0);
compressionam_alter_access_method_finish(relid, !to_compressionam);
break;
}

View File

@ -74,15 +74,15 @@ WHERE location = 1;
-- We should be able to set the table access method for a chunk, which
-- will automatically compress the chunk.
ALTER TABLE :chunk SET ACCESS METHOD tscompression;
ALTER TABLE :chunk SET ACCESS METHOD hyperstore;
SET timescaledb.enable_transparent_decompression TO false;
-- Show access method used on chunk
SELECT c.relname, a.amname FROM pg_class c
INNER JOIN pg_am a ON (c.relam = a.oid)
WHERE c.oid = :'chunk'::regclass;
relname | amname
------------------+---------------
_hyper_1_1_chunk | tscompression
relname | amname
------------------+------------
_hyper_1_1_chunk | hyperstore
(1 row)
-- This should show the chunk as compressed
@ -529,7 +529,7 @@ SELECT * FROM chunk_data_attrstats;
-- ANALYZE also via hypertable root and show that it will
-- recurse to another chunk
ALTER TABLE :chunk2 SET ACCESS METHOD tscompression;
ALTER TABLE :chunk2 SET ACCESS METHOD hyperstore;
SELECT relname, reltuples, relpages
FROM pg_class
WHERE oid = :'chunk2'::regclass;
@ -668,9 +668,9 @@ FROM orig JOIN decomp USING (device) WHERE orig.count != decomp.count;
1 | 17384 | 17388 | 4
(1 row)
-- Convert back to tscompression to check that metadata was cleaned up
-- from last time this table used tscompression
ALTER TABLE :chunk SET ACCESS METHOD tscompression;
-- Convert back to hyperstore to check that metadata was cleaned up
-- from last time this table used hyperstore
ALTER TABLE :chunk SET ACCESS METHOD hyperstore;
SET timescaledb.enable_transparent_decompression TO false;
-- Get the chunk's corresponding compressed chunk
SELECT format('%I.%I', c2.schema_name, c2.table_name)::regclass AS cchunk

View File

@ -36,7 +36,7 @@ select format('%I.%I', chunk_schema, chunk_name)::regclass as chunk
from timescaledb_information.chunks
where format('%I.%I', hypertable_schema, hypertable_name)::regclass = 'readings'::regclass
limit 1 \gset
alter table :chunk set access method tscompression;
alter table :chunk set access method hyperstore;
--
-- Check that TID scan works for both compressed and non-compressed
-- rows.

View File

@ -115,7 +115,7 @@ if((${PG_VERSION_MAJOR} GREATER_EQUAL "15"))
merge_compress.sql
cagg_query_using_merge.sql
cagg_refresh_using_merge.sql
compression_tam.sql
hyperstore.sql
hyperstore_scans.sql)
endif()

View File

@ -52,7 +52,7 @@ WHERE location = 1;
-- We should be able to set the table access method for a chunk, which
-- will automatically compress the chunk.
ALTER TABLE :chunk SET ACCESS METHOD tscompression;
ALTER TABLE :chunk SET ACCESS METHOD hyperstore;
SET timescaledb.enable_transparent_decompression TO false;
-- Show access method used on chunk
@ -256,7 +256,7 @@ SELECT * FROM chunk_data_attrstats;
-- ANALYZE also via hypertable root and show that it will
-- recurse to another chunk
ALTER TABLE :chunk2 SET ACCESS METHOD tscompression;
ALTER TABLE :chunk2 SET ACCESS METHOD hyperstore;
SELECT relname, reltuples, relpages
FROM pg_class
WHERE oid = :'chunk2'::regclass;
@ -334,9 +334,9 @@ SELECT device, count(*) INTO decomp FROM readings GROUP BY device;
SELECT device, orig.count AS orig_count, decomp.count AS decomp_count, (decomp.count - orig.count) AS diff
FROM orig JOIN decomp USING (device) WHERE orig.count != decomp.count;
-- Convert back to tscompression to check that metadata was cleaned up
-- from last time this table used tscompression
ALTER TABLE :chunk SET ACCESS METHOD tscompression;
-- Convert back to hyperstore to check that metadata was cleaned up
-- from last time this table used hyperstore
ALTER TABLE :chunk SET ACCESS METHOD hyperstore;
SET timescaledb.enable_transparent_decompression TO false;
-- Get the chunk's corresponding compressed chunk

View File

@ -32,7 +32,7 @@ select format('%I.%I', chunk_schema, chunk_name)::regclass as chunk
where format('%I.%I', hypertable_schema, hypertable_name)::regclass = 'readings'::regclass
limit 1 \gset
alter table :chunk set access method tscompression;
alter table :chunk set access method hyperstore;
--
-- Check that TID scan works for both compressed and non-compressed