Skip to content

Commit

Permalink
Release 2.14.1
Browse files Browse the repository at this point in the history
This release contains bug fixes since the 2.14.0 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#6630 Add views for per chunk compression settings

**Bugfixes**
* timescale#6636 Fixes extension update of compressed hypertables with dropped columns
* timescale#6637 Reset sequence numbers on non-rollup compression
* timescale#6639 Disable default indexscan for compression
* timescale#6651 Fix DecompressChunk path generation with per chunk settings

**Thanks**
* @anajavi for reporting an issue with extension update of compressed hypertables
  • Loading branch information
svenklemm committed Feb 14, 2024
1 parent e44e0ad commit 59f50f2
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 62 deletions.
1 change: 0 additions & 1 deletion .unreleased/pr_6630

This file was deleted.

2 changes: 0 additions & 2 deletions .unreleased/pr_6636

This file was deleted.

19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
`psql` with the `-X` flag to prevent any `.psqlrc` commands from
accidentally triggering the load of a previous DB version.**

## 2.14.1 (2024-02-14)

This release contains bug fixes since the 2.14.0 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #6630 Add views for per chunk compression settings

**Bugfixes**
* #6636 Fixes extension update of compressed hypertables with dropped columns
* #6637 Reset sequence numbers on non-rollup compression
* #6639 Disable default indexscan for compression
* #6651 Fix DecompressChunk path generation with per chunk settings

**Thanks**
* @anajavi for reporting an issue with extension update of compressed hypertables

## 2.14.0 (2024-02-08)

This release contains performance improvements and bug fixes since
Expand Down Expand Up @@ -107,7 +124,7 @@ We recommend that you upgrade at the next available opportunity.
This release contains performance improvements, an improved hypertable DDL API
and bug fixes since the 2.12.2 release. We recommend that you upgrade at the next
available opportunity.

In addition, it includes these noteworthy features:

* Full PostgreSQL 16 support for all existing features
Expand Down
3 changes: 2 additions & 1 deletion sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ set(MOD_FILES
updates/2.12.1--2.12.2.sql
updates/2.12.2--2.13.0.sql
updates/2.13.0--2.13.1.sql
updates/2.13.1--2.14.0.sql)
updates/2.13.1--2.14.0.sql
updates/2.14.0--2.14.1.sql)

# The downgrade file to generate a downgrade script for the current version, as
# specified in version.config
Expand Down
57 changes: 57 additions & 0 deletions sql/updates/2.14.0--2.14.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

CREATE VIEW timescaledb_information.hypertable_compression_settings AS
SELECT
format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable,
array_to_string(segmentby,',') AS segmentby,
un.orderby,
d.compress_interval_length
FROM _timescaledb_catalog.hypertable ht
JOIN LATERAL (
SELECT
CASE WHEN d.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
_timescaledb_functions.to_interval(d.compress_interval_length)::text
ELSE
d.compress_interval_length::text
END AS compress_interval_length
FROM _timescaledb_catalog.dimension d WHERE d.hypertable_id = ht.id ORDER BY id LIMIT 1
) d ON true
LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ht.schema_name,ht.table_name)::regclass = s.relid
LEFT JOIN LATERAL (
SELECT
string_agg(
format('%I%s%s',orderby,
CASE WHEN "desc" THEN ' DESC' ELSE '' END,
CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END
)
,',') AS orderby
FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst)
) un ON true;

CREATE VIEW timescaledb_information.chunk_compression_settings AS
SELECT
format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable,
format('%I.%I',ch.schema_name,ch.table_name)::regclass AS chunk,
array_to_string(segmentby,',') AS segmentby,
un.orderby
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht.id
INNER JOIN _timescaledb_catalog.chunk ch2 ON ch2.id = ch.compressed_chunk_id
LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ch2.schema_name,ch2.table_name)::regclass = s.relid
LEFT JOIN LATERAL (
SELECT
string_agg(
format('%I%s%s',orderby,
CASE WHEN "desc" THEN ' DESC' ELSE '' END,
CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END
),',') AS orderby
FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst)
) un ON true;

INSERT INTO _timescaledb_catalog.compression_settings
SELECT
format('%I.%I',ch.schema_name,ch.table_name)::regclass,s.segmentby,s.orderby,s.orderby_desc,s.orderby_nullsfirst
FROM _timescaledb_catalog.hypertable ht1
INNER JOIN _timescaledb_catalog.hypertable ht2 ON ht2.id = ht1.compressed_hypertable_id
INNER JOIN _timescaledb_catalog.compression_settings s ON s.relid = format('%I.%I',ht1.schema_name,ht1.table_name)::regclass
INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht2.id ON CONFLICT DO NOTHING;

56 changes: 0 additions & 56 deletions sql/updates/latest-dev.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,3 @@ DROP FUNCTION IF EXISTS _timescaledb_functions.invalidation_process_hypertable_l
DROP FUNCTION IF EXISTS _timescaledb_functions.invalidation_process_hypertable_log(integer,integer,regtype,integer[],bigint[],bigint[],text[]);
DROP FUNCTION IF EXISTS _timescaledb_functions.hypertable_invalidation_log_delete(integer);

CREATE VIEW timescaledb_information.hypertable_compression_settings AS
SELECT
format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable,
array_to_string(segmentby,',') AS segmentby,
un.orderby,
d.compress_interval_length
FROM _timescaledb_catalog.hypertable ht
JOIN LATERAL (
SELECT
CASE WHEN d.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
_timescaledb_functions.to_interval(d.compress_interval_length)::text
ELSE
d.compress_interval_length::text
END AS compress_interval_length
FROM _timescaledb_catalog.dimension d WHERE d.hypertable_id = ht.id ORDER BY id LIMIT 1
) d ON true
LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ht.schema_name,ht.table_name)::regclass = s.relid
LEFT JOIN LATERAL (
SELECT
string_agg(
format('%I%s%s',orderby,
CASE WHEN "desc" THEN ' DESC' ELSE '' END,
CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END
)
,',') AS orderby
FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst)
) un ON true;

CREATE VIEW timescaledb_information.chunk_compression_settings AS
SELECT
format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable,
format('%I.%I',ch.schema_name,ch.table_name)::regclass AS chunk,
array_to_string(segmentby,',') AS segmentby,
un.orderby
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht.id
INNER JOIN _timescaledb_catalog.chunk ch2 ON ch2.id = ch.compressed_chunk_id
LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ch2.schema_name,ch2.table_name)::regclass = s.relid
LEFT JOIN LATERAL (
SELECT
string_agg(
format('%I%s%s',orderby,
CASE WHEN "desc" THEN ' DESC' ELSE '' END,
CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END
),',') AS orderby
FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst)
) un ON true;

INSERT INTO _timescaledb_catalog.compression_settings
SELECT
format('%I.%I',ch.schema_name,ch.table_name)::regclass,s.segmentby,s.orderby,s.orderby_desc,s.orderby_nullsfirst
FROM _timescaledb_catalog.hypertable ht1
INNER JOIN _timescaledb_catalog.hypertable ht2 ON ht2.id = ht1.compressed_hypertable_id
INNER JOIN _timescaledb_catalog.compression_settings s ON s.relid = format('%I.%I',ht1.schema_name,ht1.table_name)::regclass
INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht2.id ON CONFLICT DO NOTHING;

2 changes: 1 addition & 1 deletion version.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = 2.15.0-dev
update_from_version = 2.14.0
update_from_version = 2.14.1
downgrade_to_version = 2.14.0

0 comments on commit 59f50f2

Please sign in to comment.