-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.16.0 #7135
base: main
Are you sure you want to change the base?
Release 2.16.0 #7135
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
-- Enable tracking of statistics on a column of a hypertable. | ||
-- | ||
-- hypertable - OID of the table to which the column belongs to | ||
-- column_name - The column to track statistics for | ||
-- if_not_exists - If set, and the entry already exists, generate a notice instead of an error | ||
CREATE FUNCTION @extschema@.enable_column_stats( | ||
hypertable REGCLASS, | ||
column_name NAME, | ||
if_not_exists BOOLEAN = FALSE | ||
) RETURNS TABLE(column_stats_id INT, enabled BOOL) | ||
AS '@MODULE_PATHNAME@', 'ts_chunk_column_stats_enable' LANGUAGE C VOLATILE; | ||
|
||
-- Disable tracking of statistics on a column of a hypertable. | ||
-- | ||
-- hypertable - OID of the table to remove from | ||
-- column_name - NAME of the column on which the stats are tracked | ||
-- if_not_exists - If set, and the entry does not exist, | ||
-- generate a notice instead of an error | ||
CREATE FUNCTION @extschema@.disable_column_stats( | ||
hypertable REGCLASS, | ||
column_name NAME, | ||
if_not_exists BOOLEAN = FALSE | ||
) RETURNS TABLE(hypertable_id INT, column_name NAME, disabled BOOL) | ||
AS '@MODULE_PATHNAME@', 'ts_chunk_column_stats_disable' LANGUAGE C VOLATILE; | ||
|
||
-- Track statistics for columns of chunks from a hypertable. | ||
-- Currently, we track the min/max range for a given column across chunks. | ||
-- More statistics (like bloom filters) will be added in the future. | ||
-- | ||
-- A "special" entry for a column with invalid chunk_id, PG_INT64_MAX, | ||
-- PG_INT64_MIN indicates that min/max ranges could be computed for this column | ||
-- for chunks. | ||
-- | ||
-- The ranges can overlap across chunks. The values could be out-of-date if | ||
-- modifications/changes occur in the corresponding chunk and such entries | ||
-- should be marked as "invalid" to ensure that the chunk is in | ||
-- appropriate state to be able to use these values. Thus these entries | ||
-- are different from dimension_slice which is used for tracking partitioning | ||
-- column ranges which have different characteristics. | ||
-- | ||
-- Currently this catalog supports datatypes like INT, SERIAL, BIGSERIAL, | ||
-- DATE, TIMESTAMP etc. by storing the ranges in bigint columns. In the | ||
-- future, we could support additional datatypes (which support btree style | ||
-- >, <, = comparators) by storing their textual representation. | ||
-- | ||
CREATE TABLE _timescaledb_catalog.chunk_column_stats ( | ||
id serial NOT NULL, | ||
hypertable_id integer NOT NULL, | ||
chunk_id integer NOT NULL, | ||
column_name name NOT NULL, | ||
range_start bigint NOT NULL, | ||
range_end bigint NOT NULL, | ||
valid boolean NOT NULL, | ||
-- table constraints | ||
CONSTRAINT chunk_column_stats_pkey PRIMARY KEY (id), | ||
CONSTRAINT chunk_column_stats_ht_id_chunk_id_colname_key UNIQUE (hypertable_id, chunk_id, column_name), | ||
CONSTRAINT chunk_column_stats_range_check CHECK (range_start <= range_end), | ||
CONSTRAINT chunk_column_stats_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id), | ||
CONSTRAINT chunk_column_stats_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id) | ||
); | ||
|
||
SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.chunk_column_stats', ''); | ||
|
||
SELECT pg_catalog.pg_extension_config_dump(pg_get_serial_sequence('_timescaledb_catalog.chunk_column_stats', 'id'), ''); | ||
|
||
GRANT SELECT ON _timescaledb_catalog.chunk_column_stats TO PUBLIC; | ||
GRANT SELECT ON _timescaledb_catalog.chunk_column_stats_id_seq TO PUBLIC; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DROP FUNCTION IF EXISTS _timescaledb_functions.cagg_get_bucket_function_info(INTEGER); | ||
-- remove chunk column statistics related objects | ||
DROP FUNCTION IF EXISTS @extschema@.enable_column_stats(REGCLASS, NAME, BOOLEAN); | ||
DROP FUNCTION IF EXISTS @extschema@.disable_column_stats(REGCLASS, NAME, BOOLEAN); | ||
ALTER EXTENSION timescaledb DROP TABLE _timescaledb_catalog.chunk_column_stats; | ||
ALTER EXTENSION timescaledb DROP SEQUENCE _timescaledb_catalog.chunk_column_stats_id_seq; | ||
DROP TABLE IF EXISTS _timescaledb_catalog.chunk_column_stats; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +0,0 @@ | ||
-- Enable tracking of statistics on a column of a hypertable. | ||
-- | ||
-- hypertable - OID of the table to which the column belongs to | ||
-- column_name - The column to track statistics for | ||
-- if_not_exists - If set, and the entry already exists, generate a notice instead of an error | ||
CREATE FUNCTION @extschema@.enable_column_stats( | ||
hypertable REGCLASS, | ||
column_name NAME, | ||
if_not_exists BOOLEAN = FALSE | ||
) RETURNS TABLE(column_stats_id INT, enabled BOOL) | ||
AS '@MODULE_PATHNAME@', 'ts_chunk_column_stats_enable' LANGUAGE C VOLATILE; | ||
|
||
-- Disable tracking of statistics on a column of a hypertable. | ||
-- | ||
-- hypertable - OID of the table to remove from | ||
-- column_name - NAME of the column on which the stats are tracked | ||
-- if_not_exists - If set, and the entry does not exist, | ||
-- generate a notice instead of an error | ||
CREATE FUNCTION @extschema@.disable_column_stats( | ||
hypertable REGCLASS, | ||
column_name NAME, | ||
if_not_exists BOOLEAN = FALSE | ||
) RETURNS TABLE(hypertable_id INT, column_name NAME, disabled BOOL) | ||
AS '@MODULE_PATHNAME@', 'ts_chunk_column_stats_disable' LANGUAGE C VOLATILE; | ||
|
||
-- Track statistics for columns of chunks from a hypertable. | ||
-- Currently, we track the min/max range for a given column across chunks. | ||
-- More statistics (like bloom filters) will be added in the future. | ||
-- | ||
-- A "special" entry for a column with invalid chunk_id, PG_INT64_MAX, | ||
-- PG_INT64_MIN indicates that min/max ranges could be computed for this column | ||
-- for chunks. | ||
-- | ||
-- The ranges can overlap across chunks. The values could be out-of-date if | ||
-- modifications/changes occur in the corresponding chunk and such entries | ||
-- should be marked as "invalid" to ensure that the chunk is in | ||
-- appropriate state to be able to use these values. Thus these entries | ||
-- are different from dimension_slice which is used for tracking partitioning | ||
-- column ranges which have different characteristics. | ||
-- | ||
-- Currently this catalog supports datatypes like INT, SERIAL, BIGSERIAL, | ||
-- DATE, TIMESTAMP etc. by storing the ranges in bigint columns. In the | ||
-- future, we could support additional datatypes (which support btree style | ||
-- >, <, = comparators) by storing their textual representation. | ||
-- | ||
CREATE TABLE _timescaledb_catalog.chunk_column_stats ( | ||
id serial NOT NULL, | ||
hypertable_id integer NOT NULL, | ||
chunk_id integer NOT NULL, | ||
column_name name NOT NULL, | ||
range_start bigint NOT NULL, | ||
range_end bigint NOT NULL, | ||
valid boolean NOT NULL, | ||
-- table constraints | ||
CONSTRAINT chunk_column_stats_pkey PRIMARY KEY (id), | ||
CONSTRAINT chunk_column_stats_ht_id_chunk_id_colname_key UNIQUE (hypertable_id, chunk_id, column_name), | ||
CONSTRAINT chunk_column_stats_range_check CHECK (range_start <= range_end), | ||
CONSTRAINT chunk_column_stats_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id), | ||
CONSTRAINT chunk_column_stats_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id) | ||
); | ||
|
||
SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.chunk_column_stats', ''); | ||
|
||
SELECT pg_catalog.pg_extension_config_dump(pg_get_serial_sequence('_timescaledb_catalog.chunk_column_stats', 'id'), ''); | ||
|
||
GRANT SELECT ON _timescaledb_catalog.chunk_column_stats TO PUBLIC; | ||
GRANT SELECT ON _timescaledb_catalog.chunk_column_stats_id_seq TO PUBLIC; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +0,0 @@ | ||
DROP FUNCTION IF EXISTS _timescaledb_functions.cagg_get_bucket_function_info(INTEGER); | ||
-- remove chunk column statistics related objects | ||
DROP FUNCTION IF EXISTS @extschema@.enable_column_stats(REGCLASS, NAME, BOOLEAN); | ||
DROP FUNCTION IF EXISTS @extschema@.disable_column_stats(REGCLASS, NAME, BOOLEAN); | ||
ALTER EXTENSION timescaledb DROP TABLE _timescaledb_catalog.chunk_column_stats; | ||
ALTER EXTENSION timescaledb DROP SEQUENCE _timescaledb_catalog.chunk_column_stats_id_seq; | ||
DROP TABLE IF EXISTS _timescaledb_catalog.chunk_column_stats; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version = 2.16.0-dev | ||
version = 2.16.0 | ||
update_from_version = 2.15.3 | ||
downgrade_to_version = 2.15.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@svenklemm @antekresic @fabriziomello can you check and let me know if this looks good & whether I missed anything?
@pallavisontakke I am missing more than a few things that are in the milestone from the description and the list that follows. Like for example the PR by Fabrizio on the CAggs improvements and various other PRs above 7100
@sven check what I wrote about FKs - I am assuming that this will make it for the release. Otherwise, we should remove