Skip to content

Commit cd0b26e

Browse files
committed
Remove hypercore table access method
The hypercore table access method was an experiment that did not show the signals we hoped for so with 2.22 it will no longer be available. Any upgrade from previous versions with relations using the hypercore table access method will be blocked.
1 parent 4a6896c commit cd0b26e

File tree

153 files changed

+373
-27844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+373
-27844
lines changed

.github/workflows/linux-32bit-build-and-test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ jobs:
5959
compress_bloom_sparse_debug
6060
compress_qualpushdown_saop
6161
compression_allocation
62-
hypercore_parallel
63-
hypercore_vacuum
64-
hypercore_vectoragg
6562
pg_dump
6663
telemetry
6764
transparent_decompress_chunk-*

.github/workflows/windows-build-and-test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ jobs:
8787
SKIPS: >-
8888
bgw_db_scheduler
8989
bgw_db_scheduler_fixed
90-
hypercore_vectoragg
9190
vector_agg_groupagg
9291
vector_agg_grouping
9392
vector_agg_text

cmake/ScriptFiles.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ set(PRE_INSTALL_SOURCE_FILES
1616
pre_install/types.post.sql # Must be before tables.sql
1717
pre_install/tables.sql
1818
pre_install/cache.sql
19-
pre_install/tam.functions.sql
20-
pre_install/tam.sql
2119
pre_install/insert_data.sql)
2220

2321
# Source files that define functions and need to be rerun in update
2422
set(PRE_INSTALL_FUNCTION_FILES
2523
pre_install/types.functions.sql
26-
pre_install/tam.functions.sql
2724
)
2825

2926
# The rest of the source files defining mostly functions

sql/debug_utils.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@
99
CREATE OR REPLACE FUNCTION _timescaledb_debug.extension_state() RETURNS TEXT
1010
AS '@MODULE_PATHNAME@', 'ts_extension_get_state' LANGUAGE C;
1111

12-
CREATE OR REPLACE FUNCTION _timescaledb_debug.is_compressed_tid(tid) RETURNS BOOL
13-
AS '@MODULE_PATHNAME@', 'ts_is_compressed_tid' LANGUAGE C STRICT;
14-
15-
GRANT EXECUTE ON FUNCTION _timescaledb_debug.is_compressed_tid TO PUBLIC;
16-

sql/maintenance_utils.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ CREATE OR REPLACE FUNCTION _timescaledb_functions.create_compressed_chunk(
3535
CREATE OR REPLACE FUNCTION @[email protected]_chunk(
3636
uncompressed_chunk REGCLASS,
3737
if_not_compressed BOOLEAN = true,
38-
recompress BOOLEAN = false,
39-
hypercore_use_access_method BOOL = NULL
38+
recompress BOOLEAN = false
4039
) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C VOLATILE;
4140

4241
-- Alias for compress_chunk above.
4342
CREATE OR REPLACE PROCEDURE @[email protected]_to_columnstore(
4443
chunk REGCLASS,
4544
if_not_columnstore BOOLEAN = true,
46-
recompress BOOLEAN = false,
47-
hypercore_use_access_method BOOL = NULL
45+
recompress BOOLEAN = false
4846
) AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C;
4947

5048
CREATE OR REPLACE FUNCTION @[email protected]_chunk(

sql/policy_api.sql

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ CREATE OR REPLACE FUNCTION @[email protected]_compression_policy(
5252
schedule_interval INTERVAL = NULL,
5353
initial_start TIMESTAMPTZ = NULL,
5454
timezone TEXT = NULL,
55-
compress_created_before INTERVAL = NULL,
56-
hypercore_use_access_method BOOL = NULL
55+
compress_created_before INTERVAL = NULL
5756
)
5857
RETURNS INTEGER
5958
AS '@MODULE_PATHNAME@', 'ts_policy_compression_add'
@@ -66,8 +65,7 @@ CREATE OR REPLACE PROCEDURE @[email protected]_columnstore_policy(
6665
schedule_interval INTERVAL = NULL,
6766
initial_start TIMESTAMPTZ = NULL,
6867
timezone TEXT = NULL,
69-
created_before INTERVAL = NULL,
70-
hypercore_use_access_method BOOL = NULL
68+
created_before INTERVAL = NULL
7169
) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_policy_compression_add';
7270

7371
CREATE OR REPLACE FUNCTION @[email protected]_compression_policy(hypertable REGCLASS, if_exists BOOL = false) RETURNS BOOL
@@ -129,11 +127,8 @@ CREATE OR REPLACE FUNCTION timescaledb_experimental.add_policies(
129127
refresh_start_offset "any" = NULL,
130128
refresh_end_offset "any" = NULL,
131129
compress_after "any" = NULL,
132-
drop_after "any" = NULL,
133-
hypercore_use_access_method BOOL = NULL)
134-
RETURNS BOOL
135-
AS '@MODULE_PATHNAME@', 'ts_policies_add'
136-
LANGUAGE C VOLATILE;
130+
drop_after "any" = NULL
131+
) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_policies_add' LANGUAGE C VOLATILE;
137132

138133
/* Remove policies */
139134
CREATE OR REPLACE FUNCTION timescaledb_experimental.remove_policies(

sql/policy_internal.sql

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ _timescaledb_functions.policy_compression_execute(
5151
verbose_log BOOLEAN,
5252
recompress_enabled BOOLEAN,
5353
reindex_enabled BOOLEAN,
54-
use_creation_time BOOLEAN,
55-
useam BOOLEAN = NULL)
54+
use_creation_time BOOLEAN
55+
)
5656
AS $$
5757
DECLARE
5858
htoid REGCLASS;
@@ -115,7 +115,7 @@ BEGIN
115115
LOOP
116116
BEGIN
117117
IF chunk_rec.status = bit_compressed OR recompress_enabled IS TRUE THEN
118-
PERFORM @[email protected]_chunk(chunk_rec.oid, hypercore_use_access_method => useam);
118+
PERFORM @[email protected]_chunk(chunk_rec.oid);
119119
numchunks_compressed := numchunks_compressed + 1;
120120
END IF;
121121
EXCEPTION WHEN OTHERS THEN
@@ -197,7 +197,6 @@ DECLARE
197197
recompress_enabled BOOL;
198198
reindex_enabled BOOL;
199199
use_creation_time BOOL := FALSE;
200-
hypercore_use_access_method BOOL;
201200
BEGIN
202201

203202
-- procedures with SET clause cannot execute transaction
@@ -239,18 +238,16 @@ BEGIN
239238
lag_value := compress_after;
240239
END IF;
241240

242-
hypercore_use_access_method := jsonb_object_field_text(config, 'hypercore_use_access_method')::bool;
243-
244241
-- execute the properly type casts for the lag value
245242
CASE dimtype
246243
WHEN 'TIMESTAMP'::regtype, 'TIMESTAMPTZ'::regtype, 'DATE'::regtype, 'INTERVAL' ::regtype THEN
247-
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::INTERVAL, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time, hypercore_use_access_method);
244+
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::INTERVAL, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time);
248245
WHEN 'BIGINT'::regtype THEN
249-
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::BIGINT, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time, hypercore_use_access_method);
246+
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::BIGINT, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time);
250247
WHEN 'INTEGER'::regtype THEN
251-
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::INTEGER, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time, hypercore_use_access_method);
248+
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::INTEGER, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time);
252249
WHEN 'SMALLINT'::regtype THEN
253-
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::SMALLINT, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time, hypercore_use_access_method);
250+
CALL _timescaledb_functions.policy_compression_execute(job_id, htid, lag_value::SMALLINT, maxchunks, verbose_log, recompress_enabled, reindex_enabled, use_creation_time);
254251
END CASE;
255252
COMMIT;
256253
END;

sql/pre_install/tam.functions.sql

Lines changed: 0 additions & 10 deletions
This file was deleted.

sql/pre_install/tam.sql

Lines changed: 0 additions & 20 deletions
This file was deleted.

sql/updates/latest-dev.sql

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
-- block upgrade if hypercore access method is still in use
3+
DO $$
4+
BEGIN
5+
IF EXISTS(SELECT from pg_class c join pg_am am ON c.relam=am.oid AND am.amname='hypercore') THEN
6+
RAISE EXCEPTION 'TimescaleDB does no longer support the hypercore table access method. Convert all tables to heap access method before upgrading.';
7+
END IF;
8+
END
9+
$$;
10+
11+
DROP OPERATOR CLASS IF EXISTS int4_ops USING hypercore_proxy;
12+
DROP ACCESS METHOD IF EXISTS hypercore_proxy;
13+
DROP ACCESS METHOD IF EXISTS hypercore;
14+
15+
DROP FUNCTION IF EXISTS ts_hypercore_proxy_handler;
16+
DROP FUNCTION IF EXISTS ts_hypercore_handler;
17+
DROP FUNCTION IF EXISTS _timescaledb_debug.is_compressed_tid;
18+
19+
DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute;
20+
DROP FUNCTION IF EXISTS @[email protected]_compression_policy;
21+
DROP PROCEDURE IF EXISTS @[email protected]_columnstore_policy;
22+
DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies;
23+
DROP FUNCTION IF EXISTS @[email protected]_chunk;
24+
DROP FUNCTION IF EXISTS @[email protected]_to_columnstore;
25+
26+
CREATE FUNCTION @[email protected]_chunk(
27+
uncompressed_chunk REGCLASS,
28+
if_not_compressed BOOLEAN = true,
29+
recompress BOOLEAN = false
30+
) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C VOLATILE;
31+
32+
CREATE PROCEDURE @[email protected]_to_columnstore(
33+
chunk REGCLASS,
34+
if_not_columnstore BOOLEAN = true,
35+
recompress BOOLEAN = false
36+
) AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C;
37+
38+
CREATE OR REPLACE FUNCTION @[email protected]_compression_policy(
39+
hypertable REGCLASS,
40+
compress_after "any" = NULL,
41+
if_not_exists BOOL = false,
42+
schedule_interval INTERVAL = NULL,
43+
initial_start TIMESTAMPTZ = NULL,
44+
timezone TEXT = NULL,
45+
compress_created_before INTERVAL = NULL
46+
)
47+
RETURNS INTEGER
48+
AS '@MODULE_PATHNAME@', 'ts_update_placeholder'
49+
LANGUAGE C VOLATILE;
50+
51+
CREATE PROCEDURE @[email protected]_columnstore_policy(
52+
hypertable REGCLASS,
53+
after "any" = NULL,
54+
if_not_exists BOOL = false,
55+
schedule_interval INTERVAL = NULL,
56+
initial_start TIMESTAMPTZ = NULL,
57+
timezone TEXT = NULL,
58+
created_before INTERVAL = NULL
59+
) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_update_placeholder';
60+
61+
CREATE FUNCTION timescaledb_experimental.add_policies(
62+
relation REGCLASS,
63+
if_not_exists BOOL = false,
64+
refresh_start_offset "any" = NULL,
65+
refresh_end_offset "any" = NULL,
66+
compress_after "any" = NULL,
67+
drop_after "any" = NULL
68+
) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C VOLATILE;
69+
70+
CREATE PROCEDURE _timescaledb_functions.policy_compression_execute(
71+
job_id INTEGER,
72+
htid INTEGER,
73+
lag ANYELEMENT,
74+
maxchunks INTEGER,
75+
verbose_log BOOLEAN,
76+
recompress_enabled BOOLEAN,
77+
reindex_enabled BOOLEAN,
78+
use_creation_time BOOLEAN
79+
)
80+
AS $$ $$ LANGUAGE PLPGSQL;

0 commit comments

Comments
 (0)