Skip to content
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

Index scan support during UPDATE/DELETE on compressed hypertables. #5586

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

sb230132
Copy link
Contributor

During UPDATE/DELETE on compressed hypertables, we do a sequential scan which can be improved by supporting index scans.

In this patch for a given UPDATE/DELETE query, if there are any WHERE conditions specified using SEGMENT BY columns, we use index scan to fetch all matching rows. Fetched rows will be decompressed and moved to uncompressed chunk and a regular UPDATE/DELETE is performed on the uncompressed chunk.

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #5586 (d6cd2bd) into main (9c7ae3e) will decrease coverage by 8.50%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main    #5586      +/-   ##
==========================================
- Coverage   87.88%   79.39%   -8.50%     
==========================================
  Files         239      239              
  Lines       55483    48715    -6768     
  Branches    12288    12197      -91     
==========================================
- Hits        48763    38675   -10088     
+ Misses       4844     4269     -575     
- Partials     1876     5771    +3895     
Impacted Files Coverage Δ
.../constraint_aware_append/constraint_aware_append.c 81.95% <50.00%> (-3.89%) ⬇️
tsl/src/compression/compression.c 83.46% <80.29%> (-9.24%) ⬇️

... and 222 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sb230132 sb230132 marked this pull request as ready for review April 19, 2023 06:39
@sb230132 sb230132 requested a review from antekresic April 19, 2023 06:39
@github-actions github-actions bot requested review from mahipv and pmwkaa April 19, 2023 06:39
@github-actions
Copy link

@pmwkaa, @mahipv: please review this pull request.

Powered by pull-review

@sb230132 sb230132 requested review from svenklemm and removed request for pmwkaa and mahipv April 19, 2023 06:39
Copy link
Contributor

@kgyrtkirk kgyrtkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't got to the bottom of it - but I think I've noted some things which might be usefull

tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
@sb230132 sb230132 force-pushed the index_scan branch 2 times, most recently from 698d223 to bf6842f Compare April 20, 2023 12:41
@sb230132 sb230132 requested a review from kgyrtkirk April 20, 2023 14:09
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/test/expected/compression_update_delete.out Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
Copy link
Contributor

@antekresic antekresic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add some more testing to confirm index is actually used.

tsl/test/sql/compression_update_delete.sql Outdated Show resolved Hide resolved
tsl/test/sql/compression_update_delete.sql Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
Copy link
Contributor

@antekresic antekresic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor nit/question. 🎉

tsl/src/compression/compression.c Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
tsl/src/compression/compression.c Outdated Show resolved Hide resolved
@sb230132 sb230132 force-pushed the index_scan branch 2 times, most recently from 6d897d3 to 4fe1635 Compare May 8, 2023 06:51
@sb230132 sb230132 force-pushed the index_scan branch 3 times, most recently from 56e597f to 989d9db Compare June 5, 2023 13:21
@sb230132 sb230132 force-pushed the index_scan branch 2 times, most recently from 08a5a75 to 89cdeff Compare June 13, 2023 12:02
Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There still seem to be some problems:

CREATE table t2(time timestamptz,device text,value float);
SELECT create_hypertable('t2','time');
ALTER TABLE t2 SET (timescaledb.compress,timescaledb.compress_segmentby='device');
INSERT INTO t2 SELECT '2020-01-01','d1',1;
INSERT INTO t2 SELECT '2020-01-01','d1',2;
SELECT compress_chunk(show_chunks('t2'));

DROP INDEX _timescaledb_internal._compressed_hypertable_4_device__ts_meta_sequence_num_idx;
CREATE INDEX ON _timescaledb_internal._compressed_hypertable_4 (_ts_meta_min_1);
CREATE INDEX ON _timescaledb_internal._compressed_hypertable_4 (device,_ts_meta_sequence_num);

sven@dev[937130]=# BEGIN;DELETE FROM t2 WHERE device='d1';ROLLBACK;
BEGIN
Time: 1.610 ms
ERROR:  XX000: operator 98 is not a member of opfamily 434
LOCATION:  get_op_opfamily_properties, lsyscache.c:147
Time: 2641.740 ms (00:02.642)
ROLLBACK
Time: 1.379 ms


@sb230132
Copy link
Contributor Author

There still seem to be some problems:

CREATE table t2(time timestamptz,device text,value float);
SELECT create_hypertable('t2','time');
ALTER TABLE t2 SET (timescaledb.compress,timescaledb.compress_segmentby='device');
INSERT INTO t2 SELECT '2020-01-01','d1',1;
INSERT INTO t2 SELECT '2020-01-01','d1',2;
SELECT compress_chunk(show_chunks('t2'));

DROP INDEX _timescaledb_internal._compressed_hypertable_4_device__ts_meta_sequence_num_idx;
CREATE INDEX ON _timescaledb_internal._compressed_hypertable_4 (_ts_meta_min_1);
CREATE INDEX ON _timescaledb_internal._compressed_hypertable_4 (device,_ts_meta_sequence_num);

sven@dev[937130]=# BEGIN;DELETE FROM t2 WHERE device='d1';ROLLBACK;
BEGIN
Time: 1.610 ms
ERROR:  XX000: operator 98 is not a member of opfamily 434
LOCATION:  get_op_opfamily_properties, lsyscache.c:147
Time: 2641.740 ms (00:02.642)
ROLLBACK
Time: 1.379 ms

Thanks for the testcase.

I introduced a new function find_matching_index(). This function will return a index which has all columns specified in the WHERE predicate. This matching index will be used to do a scan, filter out the rows based on scankeys etc.

Added testcase too.

Comment on lines 3023 to 3026
plan->targetlist = NULL;
plan->qual = predicates;
plan->lefttree = NULL;
plan->righttree = NULL;
node->scan.scanrelid = in_rel->rd_id;
node->indexid = index_rel->rd_id;
node->indexqual = predicates;
node->indexqualorig = NULL;
node->indexorderby = NULL;
node->indexorderbyorig = NULL;
node->indexorderbyops = NULL;
node->indexorderdir = ForwardScanDirection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makeNode uses palloc0 so explicit NULL initialization is redundant

Suggested change
plan->targetlist = NULL;
plan->qual = predicates;
plan->lefttree = NULL;
plan->righttree = NULL;
node->scan.scanrelid = in_rel->rd_id;
node->indexid = index_rel->rd_id;
node->indexqual = predicates;
node->indexqualorig = NULL;
node->indexorderby = NULL;
node->indexorderbyorig = NULL;
node->indexorderbyops = NULL;
node->indexorderdir = ForwardScanDirection;
plan->qual = predicates;
node->scan.scanrelid = in_rel->rd_id;
node->indexid = index_rel->rd_id;
node->indexqual = predicates;
node->indexorderdir = ForwardScanDirection;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -2777,8 +3161,15 @@ decompress_batches_for_update_delete(Chunk *chunk, List *predicates)
ScanKeyData *scankeys = NULL;
Bitmapset *null_columns = NULL;
int num_scankeys = 0;
List *index_scankeys = NIL;
List *num_index_scankeys = NIL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

* scans on compressed chunks.
*/
static List *
build_index_scankeys(Relation in_rel, Relation index_rel, List *predicates, List **num_scankeys,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is num_scankeys a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

NULL);

*num_scankeys = lappend_int(*num_scankeys, indexstate->iss_NumScanKeys);
scankeys = lappend(scankeys, indexstate->iss_ScanKeys);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you return a list here instead of indexstate->iss_ScanKeys especially since scankeys is NULL at since point and you list will always have one entry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

{
ListCell *num_idx_keys;
ListCell *scan_idx_keys;
forboth (num_idx_keys, num_index_scankeys, scan_idx_keys, index_scankeys)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when would this list have more than one enrtry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

ordered_index_filters,
&num_index_scankeys,
estate);
if (index_scankeys)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under which circumstance would index_scankeys be NULL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment on lines +2467 to +2468
if (opno && !op_in_opfamily(opno, opfamily))
Assert(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (opno && !op_in_opfamily(opno, opfamily))
Assert(false);
Assert(opno && op_in_opfamily(opno, opfamily));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if opno is not in opfamily? Do we have a test for this?

During UPDATE/DELETE on compressed hypertables, we do a sequential
scan which can be improved by supporting index scans.

In this patch for a given UPDATE/DELETE query, if there are any
WHERE conditions specified using SEGMENT BY columns, we use index
scan to fetch all matching rows. Fetched rows will be decompressed
and moved to uncompressed chunk and a regular UPDATE/DELETE is
performed on the uncompressed chunk.
@sb230132 sb230132 enabled auto-merge (rebase) June 15, 2023 13:32
@sb230132 sb230132 merged commit c48f905 into timescale:main Jun 15, 2023
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Sep 20, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* timescale#5137 Insert into index during chunk compression
* timescale#5150 MERGE support on hypertables
* timescale#5515 Make hypertables support replica identity
* timescale#5586 Index scan support during UPDATE/DELETE on compressed hypertables
* timescale#5596 Support for partial aggregations at chunk level
* timescale#5599 Enable ChunkAppend for partially compressed chunks
* timescale#5655 Improve the number of parallel workers for decompression
* timescale#5758 Enable altering job schedule type through `alter_job`
* timescale#5805 Make logrepl markers for (partial) decompressions
* timescale#5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* timescale#5839 Support CAgg names in chunk_detailed_size
* timescale#5852 Make set_chunk_time_interval CAggs aware
* timescale#5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* timescale#5875 Add job exit status and runtime to log
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* timescale#5860 Fix interval calculation for hierarchical CAggs
* timescale#5894 Check unique indexes when enabling compression
* timescale#5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* timescale#5988 Move functions to _timescaledb_functions schema
* timescale#5788 Chunk_create must add an existing table or fail
* timescale#5872 Fix duplicates on partially compressed chunk reads
* timescale#5918 Fix crash in COPY from program returning error
* timescale#5990 Place data in first/last function in correct mctx
* timescale#5991 Call eq_func correctly in time_bucket_gapfill
* timescale#6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* timescale#6035 Fix server crash on UPDATE of compressed chunk
* timescale#6044 Fix server crash when using duplicate segmentby column
* timescale#6045 Fix segfault in set_integer_now_func
* timescale#6053 Fix approximate_row_count for CAggs
* timescale#6081 Improve compressed DML datatype handling
* timescale#6084 Propagate parameter changes to decompress child nodes

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
@svenklemm svenklemm mentioned this pull request Sep 20, 2023
svenklemm added a commit that referenced this pull request Sep 20, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* #5137 Insert into index during chunk compression
* #5150 MERGE support on hypertables
* #5515 Make hypertables support replica identity
* #5586 Index scan support during UPDATE/DELETE on compressed hypertables
* #5596 Support for partial aggregations at chunk level
* #5599 Enable ChunkAppend for partially compressed chunks
* #5655 Improve the number of parallel workers for decompression
* #5758 Enable altering job schedule type through `alter_job`
* #5805 Make logrepl markers for (partial) decompressions
* #5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* #5839 Support CAgg names in chunk_detailed_size
* #5852 Make set_chunk_time_interval CAggs aware
* #5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* #5875 Add job exit status and runtime to log
* #5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* #5860 Fix interval calculation for hierarchical CAggs
* #5894 Check unique indexes when enabling compression
* #5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* #5988 Move functions to _timescaledb_functions schema
* #5788 Chunk_create must add an existing table or fail
* #5872 Fix duplicates on partially compressed chunk reads
* #5918 Fix crash in COPY from program returning error
* #5990 Place data in first/last function in correct mctx
* #5991 Call eq_func correctly in time_bucket_gapfill
* #6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* #6035 Fix server crash on UPDATE of compressed chunk
* #6044 Fix server crash when using duplicate segmentby column
* #6045 Fix segfault in set_integer_now_func
* #6053 Fix approximate_row_count for CAggs
* #6081 Improve compressed DML datatype handling
* #6084 Propagate parameter changes to decompress child nodes

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
svenklemm added a commit that referenced this pull request Sep 20, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* #5137 Insert into index during chunk compression
* #5150 MERGE support on hypertables
* #5515 Make hypertables support replica identity
* #5586 Index scan support during UPDATE/DELETE on compressed hypertables
* #5596 Support for partial aggregations at chunk level
* #5599 Enable ChunkAppend for partially compressed chunks
* #5655 Improve the number of parallel workers for decompression
* #5758 Enable altering job schedule type through `alter_job`
* #5805 Make logrepl markers for (partial) decompressions
* #5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* #5839 Support CAgg names in chunk_detailed_size
* #5852 Make set_chunk_time_interval CAggs aware
* #5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* #5875 Add job exit status and runtime to log
* #5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* #5860 Fix interval calculation for hierarchical CAggs
* #5894 Check unique indexes when enabling compression
* #5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* #5988 Move functions to _timescaledb_functions schema
* #5788 Chunk_create must add an existing table or fail
* #5872 Fix duplicates on partially compressed chunk reads
* #5918 Fix crash in COPY from program returning error
* #5990 Place data in first/last function in correct mctx
* #5991 Call eq_func correctly in time_bucket_gapfill
* #6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* #6035 Fix server crash on UPDATE of compressed chunk
* #6044 Fix server crash when using duplicate segmentby column
* #6045 Fix segfault in set_integer_now_func
* #6053 Fix approximate_row_count for CAggs
* #6081 Improve compressed DML datatype handling
* #6084 Propagate parameter changes to decompress child nodes

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
svenklemm added a commit that referenced this pull request Sep 20, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* #5137 Insert into index during chunk compression
* #5150 MERGE support on hypertables
* #5515 Make hypertables support replica identity
* #5586 Index scan support during UPDATE/DELETE on compressed hypertables
* #5596 Support for partial aggregations at chunk level
* #5599 Enable ChunkAppend for partially compressed chunks
* #5655 Improve the number of parallel workers for decompression
* #5758 Enable altering job schedule type through `alter_job`
* #5805 Make logrepl markers for (partial) decompressions
* #5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* #5839 Support CAgg names in chunk_detailed_size
* #5852 Make set_chunk_time_interval CAggs aware
* #5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* #5875 Add job exit status and runtime to log
* #5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* #5860 Fix interval calculation for hierarchical CAggs
* #5894 Check unique indexes when enabling compression
* #5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* #5988 Move functions to _timescaledb_functions schema
* #5788 Chunk_create must add an existing table or fail
* #5872 Fix duplicates on partially compressed chunk reads
* #5918 Fix crash in COPY from program returning error
* #5990 Place data in first/last function in correct mctx
* #5991 Call eq_func correctly in time_bucket_gapfill
* #6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* #6035 Fix server crash on UPDATE of compressed chunk
* #6044 Fix server crash when using duplicate segmentby column
* #6045 Fix segfault in set_integer_now_func
* #6053 Fix approximate_row_count for CAggs
* #6081 Improve compressed DML datatype handling
* #6084 Propagate parameter changes to decompress child nodes

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
svenklemm added a commit that referenced this pull request Sep 25, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* #5137 Insert into index during chunk compression
* #5150 MERGE support on hypertables
* #5515 Make hypertables support replica identity
* #5586 Index scan support during UPDATE/DELETE on compressed hypertables
* #5596 Support for partial aggregations at chunk level
* #5599 Enable ChunkAppend for partially compressed chunks
* #5655 Improve the number of parallel workers for decompression
* #5758 Enable altering job schedule type through `alter_job`
* #5805 Make logrepl markers for (partial) decompressions
* #5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* #5839 Support CAgg names in chunk_detailed_size
* #5852 Make set_chunk_time_interval CAggs aware
* #5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* #5875 Add job exit status and runtime to log
* #5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* #5860 Fix interval calculation for hierarchical CAggs
* #5894 Check unique indexes when enabling compression
* #5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* #5988 Move functions to _timescaledb_functions schema
* #5788 Chunk_create must add an existing table or fail
* #5872 Fix duplicates on partially compressed chunk reads
* #5918 Fix crash in COPY from program returning error
* #5990 Place data in first/last function in correct mctx
* #5991 Call eq_func correctly in time_bucket_gapfill
* #6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* #6035 Fix server crash on UPDATE of compressed chunk
* #6044 Fix server crash when using duplicate segmentby column
* #6045 Fix segfault in set_integer_now_func
* #6053 Fix approximate_row_count for CAggs
* #6081 Improve compressed DML datatype handling
* #6084 Propagate parameter changes to decompress child nodes
* #6102 Schedule compression policy more often

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
svenklemm added a commit that referenced this pull request Sep 25, 2023
This release contains performance improvements for compressed hypertables
and continuous aggregates and bug fixes since the 2.11.2 release.
We recommend that you upgrade at the next available opportunity.

This release moves all internal functions from the _timescaleb_internal
schema into the _timescaledb_functions schema. This separates code from
internal data objects and improves security by allowing more restrictive
permissions for the code schema. If you are calling any of those internal
functions you should adjust your code as soon as possible. This version
also includes a compatibility layer that allows calling them in the old
location but that layer will be removed in 2.14.0.

**PostgreSQL 12 support removal announcement**
Following the deprecation announcement for PostgreSQL 12 in TimescaleDB 2.10,
PostgreSQL 12 is not supported starting with TimescaleDB 2.12.
Currently supported PostgreSQL major versions are 13, 14 and 15.
PostgreSQL 16 support will be added with a following TimescaleDB release.

**Features**
* #5137 Insert into index during chunk compression
* #5150 MERGE support on hypertables
* #5515 Make hypertables support replica identity
* #5586 Index scan support during UPDATE/DELETE on compressed hypertables
* #5596 Support for partial aggregations at chunk level
* #5599 Enable ChunkAppend for partially compressed chunks
* #5655 Improve the number of parallel workers for decompression
* #5758 Enable altering job schedule type through `alter_job`
* #5805 Make logrepl markers for (partial) decompressions
* #5809 Relax invalidation threshold table-level lock to row-level when refreshing a Continuous Aggregate
* #5839 Support CAgg names in chunk_detailed_size
* #5852 Make set_chunk_time_interval CAggs aware
* #5868 Allow ALTER TABLE ... REPLICA IDENTITY (FULL|INDEX) on materialized hypertables (continuous aggregates)
* #5875 Add job exit status and runtime to log
* #5909 CREATE INDEX ONLY ON hypertable creates index on chunks

**Bugfixes**
* #5860 Fix interval calculation for hierarchical CAggs
* #5894 Check unique indexes when enabling compression
* #5951 _timescaledb_internal.create_compressed_chunk doesn't account for existing uncompressed rows
* #5988 Move functions to _timescaledb_functions schema
* #5788 Chunk_create must add an existing table or fail
* #5872 Fix duplicates on partially compressed chunk reads
* #5918 Fix crash in COPY from program returning error
* #5990 Place data in first/last function in correct mctx
* #5991 Call eq_func correctly in time_bucket_gapfill
* #6015 Correct row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT output
* #6035 Fix server crash on UPDATE of compressed chunk
* #6044 Fix server crash when using duplicate segmentby column
* #6045 Fix segfault in set_integer_now_func
* #6053 Fix approximate_row_count for CAggs
* #6081 Improve compressed DML datatype handling
* #6084 Propagate parameter changes to decompress child nodes
* #6102 Schedule compression policy more often

**Thanks**
* @ajcanterbury for reporting a problem with lateral joins on compressed chunks
* @alexanderlaw for reporting multiple server crashes
* @lukaskirner for reporting a bug with monthly continuous aggregates
* @mrksngl for reporting a bug with unusual user names
* @willsbit for reporting a crash in time_bucket_gapfill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants