-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change parameter name to enable Hypercore TAM
Changing from using the `compress_using` parameter with a table access method name to use the boolean parameter `hypercore_use_access_method` instead to avoid having to provide a name when using the table access method for compression.
- Loading branch information
Showing
40 changed files
with
181 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implements: #7411 Change parameter name to enable Hypercore TAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ CREATE OR REPLACE FUNCTION @[email protected]_chunk( | |
uncompressed_chunk REGCLASS, | ||
if_not_compressed BOOLEAN = true, | ||
recompress BOOLEAN = false, | ||
compress_using NAME = NULL | ||
hypercore_use_access_method BOOL = NULL | ||
) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C VOLATILE; | ||
|
||
CREATE OR REPLACE FUNCTION @[email protected]_chunk( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ CREATE OR REPLACE FUNCTION @[email protected]_compression_policy( | |
initial_start TIMESTAMPTZ = NULL, | ||
timezone TEXT = NULL, | ||
compress_created_before INTERVAL = NULL, | ||
compress_using NAME = NULL | ||
hypercore_use_access_method BOOL = NULL | ||
) | ||
RETURNS INTEGER | ||
AS '@MODULE_PATHNAME@', 'ts_policy_compression_add' | ||
|
@@ -95,7 +95,7 @@ CREATE OR REPLACE FUNCTION timescaledb_experimental.add_policies( | |
refresh_end_offset "any" = NULL, | ||
compress_after "any" = NULL, | ||
drop_after "any" = NULL, | ||
compress_using NAME = NULL) | ||
hypercore_use_access_method BOOL = NULL) | ||
RETURNS BOOL | ||
AS '@MODULE_PATHNAME@', 'ts_policies_add' | ||
LANGUAGE C VOLATILE; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ _timescaledb_functions.policy_compression_execute( | |
verbose_log BOOLEAN, | ||
recompress_enabled BOOLEAN, | ||
use_creation_time BOOLEAN, | ||
amname NAME = NULL) | ||
useam BOOLEAN = NULL) | ||
AS $$ | ||
DECLARE | ||
htoid REGCLASS; | ||
|
@@ -109,7 +109,7 @@ BEGIN | |
LOOP | ||
IF chunk_rec.status = 0 THEN | ||
BEGIN | ||
PERFORM @[email protected]_chunk(chunk_rec.oid, compress_using => amname); | ||
PERFORM @[email protected]_chunk(chunk_rec.oid, hypercore_use_access_method => useam); | ||
EXCEPTION WHEN OTHERS THEN | ||
GET STACKED DIAGNOSTICS | ||
_message = MESSAGE_TEXT, | ||
|
@@ -134,7 +134,7 @@ BEGIN | |
PERFORM _timescaledb_functions.recompress_chunk_segmentwise(chunk_rec.oid); | ||
ELSE | ||
PERFORM @[email protected]_chunk(chunk_rec.oid, if_compressed => true); | ||
PERFORM @[email protected]_chunk(chunk_rec.oid, compress_using => amname); | ||
PERFORM @[email protected]_chunk(chunk_rec.oid, hypercore_use_access_method => useam); | ||
END IF; | ||
EXCEPTION WHEN OTHERS THEN | ||
GET STACKED DIAGNOSTICS | ||
|
@@ -187,7 +187,7 @@ DECLARE | |
numchunks INTEGER := 1; | ||
recompress_enabled BOOL; | ||
use_creation_time BOOL := FALSE; | ||
compress_using TEXT; | ||
hypercore_use_access_method BOOL; | ||
BEGIN | ||
|
||
-- procedures with SET clause cannot execute transaction | ||
|
@@ -228,29 +228,29 @@ BEGIN | |
lag_value := compress_after; | ||
END IF; | ||
|
||
compress_using := jsonb_object_field_text(config, 'compress_using')::name; | ||
hypercore_use_access_method := jsonb_object_field_text(config, 'hypercore_use_access_method')::bool; | ||
|
||
-- execute the properly type casts for the lag value | ||
CASE dimtype | ||
WHEN 'TIMESTAMP'::regtype, 'TIMESTAMPTZ'::regtype, 'DATE'::regtype, 'INTERVAL' ::regtype THEN | ||
CALL _timescaledb_functions.policy_compression_execute( | ||
job_id, htid, lag_value::INTERVAL, | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, compress_using | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, hypercore_use_access_method | ||
); | ||
WHEN 'BIGINT'::regtype THEN | ||
CALL _timescaledb_functions.policy_compression_execute( | ||
job_id, htid, lag_value::BIGINT, | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, compress_using | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, hypercore_use_access_method | ||
); | ||
WHEN 'INTEGER'::regtype THEN | ||
CALL _timescaledb_functions.policy_compression_execute( | ||
job_id, htid, lag_value::INTEGER, | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, compress_using | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, hypercore_use_access_method | ||
); | ||
WHEN 'SMALLINT'::regtype THEN | ||
CALL _timescaledb_functions.policy_compression_execute( | ||
job_id, htid, lag_value::SMALLINT, | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, compress_using | ||
maxchunks, verbose_log, recompress_enabled, use_creation_time, hypercore_use_access_method | ||
); | ||
END CASE; | ||
END; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ CREATE FUNCTION @[email protected]_chunk( | |
uncompressed_chunk REGCLASS, | ||
if_not_compressed BOOLEAN = true, | ||
recompress BOOLEAN = false, | ||
compress_using NAME = NULL | ||
hypercore_use_access_method BOOL = NULL | ||
) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C VOLATILE; | ||
|
||
DROP FUNCTION IF EXISTS @[email protected]_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL); | ||
|
@@ -24,7 +24,7 @@ CREATE FUNCTION @[email protected]_compression_policy( | |
initial_start TIMESTAMPTZ = NULL, | ||
timezone TEXT = NULL, | ||
compress_created_before INTERVAL = NULL, | ||
compress_using NAME = NULL | ||
hypercore_use_access_method BOOL = NULL | ||
) | ||
RETURNS INTEGER | ||
AS '@MODULE_PATHNAME@', 'ts_update_placeholder' | ||
|
@@ -39,7 +39,7 @@ CREATE FUNCTION timescaledb_experimental.add_policies( | |
refresh_end_offset "any" = NULL, | ||
compress_after "any" = NULL, | ||
drop_after "any" = NULL, | ||
compress_using NAME = NULL) | ||
hypercore_use_access_method BOOL = NULL) | ||
RETURNS BOOL | ||
AS '@MODULE_PATHNAME@', 'ts_update_placeholder' | ||
LANGUAGE C VOLATILE; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ DROP ACCESS METHOD IF EXISTS hypercore; | |
DROP FUNCTION IF EXISTS ts_hypercore_handler; | ||
DROP FUNCTION IF EXISTS _timescaledb_debug.is_compressed_tid; | ||
|
||
DROP FUNCTION IF EXISTS @[email protected]_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN, compress_using NAME); | ||
DROP FUNCTION IF EXISTS @[email protected]_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN, hypercore_use_access_method BOOL); | ||
|
||
CREATE FUNCTION @[email protected]_chunk( | ||
uncompressed_chunk REGCLASS, | ||
if_not_compressed BOOLEAN = true, | ||
recompress BOOLEAN = false | ||
) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C STRICT VOLATILE; | ||
|
||
DROP FUNCTION IF EXISTS @[email protected]_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL, compress_using NAME); | ||
DROP FUNCTION IF EXISTS @[email protected]_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL, hypercore_use_access_method BOOL); | ||
|
||
CREATE FUNCTION @[email protected]_compression_policy( | ||
hypertable REGCLASS, | ||
|
@@ -28,7 +28,7 @@ RETURNS INTEGER | |
AS '@MODULE_PATHNAME@', 'ts_policy_compression_add' | ||
LANGUAGE C VOLATILE; | ||
|
||
DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any", compress_using NAME); | ||
DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any", hypercore_use_access_method BOOL); | ||
|
||
CREATE FUNCTION timescaledb_experimental.add_policies( | ||
relation REGCLASS, | ||
|
@@ -41,6 +41,6 @@ RETURNS BOOL | |
AS '@MODULE_PATHNAME@', 'ts_policies_add' | ||
LANGUAGE C VOLATILE; | ||
|
||
DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN, amname NAME); | ||
DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN, useam BOOLEAN); | ||
|
||
DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.