mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-14 01:10:37 +08:00
This release introduces the ability to add secondary indexes to the columnstore, improves group by and filtering performance through columnstore vectorization, and contains the highly upvoted community request of transition table support. We recommend that you upgrade at the next available opportunity. **Highlighted features in TimescaleDB v2.18.0** * The ability to add secondary indexes to the columnstore through the new hypercore table access method. * Significant performance improvements through vectorization (`SIMD`) for aggregations using a group by with one column and/or using a filter clause when querying the columnstore. * Hypertables support triggers for transition tables, which is one of the most upvoted community feature requests. * Updated methods to manage Timescale's hybrid row-columnar store (hypercore) that highlight the usage of the columnstore which includes both an optimized columnar format as well as compression. **Dropping support for Bitnami images** After the recent change in Bitnami’s [LTS support policy](https://github.com/bitnami/containers/issues/75671), we are no longer building Bitnami images for TimescaleDB. We recommend using the [official TimescaleDB Docker image](https://hub.docker.com/r/timescale/timescaledb-ha) **Deprecation Notice** We are deprecating the following parameters, functions, procedures and views. They will be removed with the next major release of TimescaleDB. Please find the replacements in the table below: | Deprecated | Replacement | Type | | --- | --- | --- | | decompress_chunk | convert_to_rowstore | Procedure | | compress_chunk | convert_to_columnstore | Procedure | | add_compression_policy | add_columnstore_policy | Function | | remove_compression_policy | remove_columnstore_policy | Function | | hypertable_compression_stats | hypertable_columnstore_stats | Function | | chunk_compression_stats | chunk_columnstore_stats | Function | | hypertable_compression_settings | hypertable_columnstore_settings | View | | chunk_compression_settings | chunk_columnstore_settings | View | | compression_settings | columnstore_settings | View | | timescaledb.compress | timescaledb.enable_columnstore | Parameter | | timescaledb.compress_segmentby | timescaledb.segmentby | Parameter | | timescaledb.compress_orderby | timescaledb.orderby | Parameter | **Features** * #7341: Vectorized aggregation with grouping by one fixed-size by-value compressed column (such as arithmetic types). * #7104: Hypercore table access method. * #6901: Add hypertable support for transition tables. * #7482: Optimize recompression of partially compressed chunks. * #7458: Support vectorized aggregation with aggregate `filter` clauses that are also vectorizable. * #7433: Add support for merging chunks. * #7271: Push down `order by` in real-time continuous aggregate queries. * #7455: Support `drop not null` on compressed hypertables. * #7295: Support `alter table set access method` on hypertable. * #7411: Change parameter name to enable hypercore table access method. * #7436: Add index creation on `order by` columns. * #7443: Add hypercore function and view aliases. * #7521: Add optional `force` argument to `refresh_continuous_aggregate`. * #7528: Transform sorting on `time_bucket` to sorting on time for compressed chunks in some cases. * #7565: Add hint when hypertable creation fails. * #7390: Disable custom `hashagg` planner code. * #7587: Add `include_tiered_data` parameter to `add_continuous_aggregate_policy` API. * #7486: Prevent building against PostgreSQL versions with broken ABI. * #7412: Add [GUC](https://www.postgresql.org/docs/current/acronyms.html#:~:text=GUC) for the `hypercore_use_access_method` default. * #7413: Add GUC for segmentwise recompression. **Bugfixes** * #7378: Remove obsolete job referencing `policy_job_error_retention`. * #7409: Update `bgw_job` table when altering procedure. * #7410: Fix the `aggregated compressed column not found` error on aggregation query. * #7426: Fix `datetime` parsing error in chunk constraint creation. * #7432: Verify that the heap tuple is valid before using. * #7434: Fix the segfault when internally setting the replica identity for a given chunk. * #7488: Emit error for transition table trigger on chunks. * #7514: Fix the error: `invalid child of chunk append`. * #7517: Fix the performance regression on the `cagg_migrate` procedure. * #7527: Restart scheduler on error. * #7557: Fix null handling for in-memory tuple filtering. * #7566: Improve transaction check in CAGG refresh. * #7584: Fix NaN-handling for vectorized aggregation. * #7598: Match the Postgres NaN comparison behavior in WHERE clause over compressed tables. **Thanks** * @bharrisau for reporting the segfault when creating chunks. * @jakehedlund for reporting the incompatible NaN behavior in WHERE clause over compressed tables. * @k-rus for suggesting that we add a hint when hypertable creation fails. * @staticlibs for sending the pull request that improves the transaction check in CAGG refresh. * @uasiddiqi for reporting the `aggregated compressed column not found` error.
94 lines
4.4 KiB
SQL
94 lines
4.4 KiB
SQL
-- Hypercore AM
|
|
DROP ACCESS METHOD IF EXISTS hypercore_proxy;
|
|
DROP FUNCTION IF EXISTS @extschema@.ts_hypercore_proxy_handler;
|
|
DROP ACCESS METHOD IF EXISTS hypercore;
|
|
DROP FUNCTION IF EXISTS @extschema@.ts_hypercore_handler;
|
|
DROP FUNCTION IF EXISTS _timescaledb_debug.is_compressed_tid;
|
|
|
|
DROP FUNCTION IF EXISTS @extschema@.compress_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN, hypercore_use_access_method BOOL);
|
|
|
|
CREATE FUNCTION @extschema@.compress_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 @extschema@.add_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 @extschema@.add_compression_policy(
|
|
hypertable REGCLASS,
|
|
compress_after "any" = NULL,
|
|
if_not_exists BOOL = false,
|
|
schedule_interval INTERVAL = NULL,
|
|
initial_start TIMESTAMPTZ = NULL,
|
|
timezone TEXT = NULL,
|
|
compress_created_before INTERVAL = NULL
|
|
)
|
|
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", hypercore_use_access_method BOOL);
|
|
|
|
CREATE FUNCTION timescaledb_experimental.add_policies(
|
|
relation REGCLASS,
|
|
if_not_exists BOOL = false,
|
|
refresh_start_offset "any" = NULL,
|
|
refresh_end_offset "any" = NULL,
|
|
compress_after "any" = NULL,
|
|
drop_after "any" = NULL)
|
|
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, useam BOOLEAN);
|
|
|
|
DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB);
|
|
DROP PROCEDURE IF EXISTS @extschema@.convert_to_columnstore(REGCLASS, BOOLEAN, BOOLEAN, BOOLEAN);
|
|
DROP PROCEDURE IF EXISTS @extschema@.convert_to_rowstore(REGCLASS, BOOLEAN);
|
|
DROP PROCEDURE IF EXISTS @extschema@.add_columnstore_policy(REGCLASS, "any", BOOL, INTERVAL, TIMESTAMPTZ, TEXT, INTERVAL, BOOL);
|
|
DROP PROCEDURE IF EXISTS @extschema@.remove_columnstore_policy(REGCLASS, BOOL);
|
|
DROP FUNCTION IF EXISTS @extschema@.hypertable_columnstore_stats(REGCLASS);
|
|
DROP FUNCTION IF EXISTS @extschema@.chunk_columnstore_stats(REGCLASS);
|
|
|
|
ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.hypertable_columnstore_settings;
|
|
ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.chunk_columnstore_settings;
|
|
|
|
DROP VIEW timescaledb_information.hypertable_columnstore_settings;
|
|
DROP VIEW timescaledb_information.chunk_columnstore_settings;
|
|
|
|
DROP PROCEDURE IF EXISTS _timescaledb_functions.cagg_migrate_update_watermark(INTEGER);
|
|
|
|
-- Recreate `refresh_continuous_aggregate` procedure to remove the `force` argument
|
|
DROP PROCEDURE IF EXISTS @extschema@.refresh_continuous_aggregate (continuous_aggregate REGCLASS, window_start "any", window_end "any", force BOOLEAN);
|
|
|
|
CREATE PROCEDURE @extschema@.refresh_continuous_aggregate(
|
|
continuous_aggregate REGCLASS,
|
|
window_start "any",
|
|
window_end "any"
|
|
) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_continuous_agg_refresh';
|
|
|
|
-- Remove `include_tiered_data` argument from `add_continuous_aggregate_policy`
|
|
DROP FUNCTION @extschema@.add_continuous_aggregate_policy(
|
|
continuous_aggregate REGCLASS, start_offset "any",
|
|
end_offset "any", schedule_interval INTERVAL,
|
|
if_not_exists BOOL,
|
|
initial_start TIMESTAMPTZ,
|
|
timezone TEXT,
|
|
include_tiered_data BOOL
|
|
);
|
|
CREATE FUNCTION @extschema@.add_continuous_aggregate_policy(
|
|
continuous_aggregate REGCLASS, start_offset "any",
|
|
end_offset "any", schedule_interval INTERVAL,
|
|
if_not_exists BOOL = false,
|
|
initial_start TIMESTAMPTZ = NULL,
|
|
timezone TEXT = NULL
|
|
)
|
|
RETURNS INTEGER
|
|
AS '@MODULE_PATHNAME@', 'ts_policy_refresh_cagg_add'
|
|
LANGUAGE C VOLATILE;
|
|
|
|
-- Merge chunks
|
|
DROP PROCEDURE IF EXISTS @extschema@.merge_chunks(chunk1 REGCLASS, chunk2 REGCLASS);
|
|
DROP PROCEDURE IF EXISTS @extschema@.merge_chunks(chunks REGCLASS[]);
|