-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc46eab
commit 5457ae1
Showing
4 changed files
with
105 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
## {{ release_current }} ({{ release_date }}) | ||
|
||
This release contains performance improvements and bug fixes since | ||
the {{ release_previous }} release. We recommend that you upgrade at the next | ||
available opportunity. | ||
|
||
In addition, it includes these noteworthy features: | ||
* Support `time_bucket` with `origin` and/or `offset` on Continuous Aggregate | ||
* Compression improvements: | ||
- Improve expression pushdown | ||
- Add minmax sparse indexes when compressing columns with btree indexes | ||
- Make compression use the defaults functions | ||
* Vectorize filters in WHERE clause that contain text equality operators and LIKE expressions | ||
|
||
**Deprecation warning** | ||
* Starting on this release will not be possible to create Continuous Aggregate using `time_bucket_ng` anymore and it will be completely removed on the upcoming releases. | ||
* Recommend users to [migrate their old Continuous Aggregate format to the new one](https://docs.timescale.com/use-timescale/latest/continuous-aggregates/migrate/) because it support will be completely removed in next releases prevent them to migrate. | ||
* PG13 deprecation?? | ||
|
||
**For on-premise users and this release only**, you will need to run the following SQL script after running `ALTER EXTENSION`. More details can be found in the pull request [#6786](https://github.com/timescale/timescaledb/pull/6797). | ||
|
||
```sql | ||
CREATE OR REPLACE FUNCTION pg_temp.constraint_columns(regclass, int2[]) RETURNS text[] AS | ||
$$ | ||
SELECT array_agg(attname) FROM unnest($2) un(attnum) LEFT JOIN pg_attribute att ON att.attrelid=$1 AND att.attnum = un.attnum; | ||
$$ LANGUAGE SQL SET search_path TO pg_catalog, pg_temp; | ||
|
||
DO $$ | ||
DECLARE | ||
ht_id int; | ||
ht regclass; | ||
chunk regclass; | ||
con_oid oid; | ||
con_frelid regclass; | ||
con_name text; | ||
con_columns text[]; | ||
chunk_id int; | ||
|
||
BEGIN | ||
|
||
-- iterate over all hypertables that have foreign key constraints | ||
FOR ht_id, ht in | ||
SELECT | ||
ht.id, | ||
format('%I.%I',ht.schema_name,ht.table_name)::regclass | ||
FROM _timescaledb_catalog.hypertable ht | ||
WHERE | ||
EXISTS ( | ||
SELECT FROM pg_constraint con | ||
WHERE | ||
con.contype='f' AND | ||
con.conrelid=format('%I.%I',ht.schema_name,ht.table_name)::regclass | ||
) | ||
LOOP | ||
RAISE NOTICE 'Hypertable % has foreign key constraint', ht; | ||
|
||
-- iterate over all foreign key constraints on the hypertable | ||
-- and check that they are present on every chunk | ||
FOR con_oid, con_frelid, con_name, con_columns IN | ||
SELECT con.oid, con.confrelid, con.conname, pg_temp.constraint_columns(con.conrelid,con.conkey) | ||
FROM pg_constraint con | ||
WHERE | ||
con.contype='f' AND | ||
con.conrelid=ht | ||
LOOP | ||
RAISE NOTICE 'Checking constraint % %', con_name, con_columns; | ||
-- check that the foreign key constraint is present on the chunk | ||
|
||
FOR chunk_id, chunk IN | ||
SELECT | ||
ch.id, | ||
format('%I.%I',ch.schema_name,ch.table_name)::regclass | ||
FROM _timescaledb_catalog.chunk ch | ||
WHERE | ||
ch.hypertable_id=ht_id | ||
LOOP | ||
RAISE NOTICE 'Checking chunk %', chunk; | ||
IF NOT EXISTS ( | ||
SELECT FROM pg_constraint con | ||
WHERE | ||
con.contype='f' AND | ||
con.conrelid=chunk AND | ||
con.confrelid=con_frelid AND | ||
pg_temp.constraint_columns(con.conrelid,con.conkey) = con_columns | ||
) THEN | ||
RAISE WARNING 'Restoring constraint % on chunk %', con_name, chunk; | ||
PERFORM _timescaledb_functions.constraint_clone(con_oid, chunk); | ||
INSERT INTO _timescaledb_catalog.chunk_constraint(chunk_id, dimension_slice_id, constraint_name, hypertable_constraint_name) VALUES (chunk_id, NULL, con_name, con_name); | ||
END IF; | ||
|
||
END LOOP; | ||
END LOOP; | ||
|
||
END LOOP; | ||
|
||
END | ||
$$; | ||
|
||
DROP FUNCTION pg_temp.constraint_columns(regclass, int2[]); | ||
``` |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Fixes: #6621 Remove metadata when dropping chunks | ||
Thanks: @ndjzurawsk For reporting error when dropping chunks | ||
Thanks: @djzurawsk For reporting error when dropping chunks |
File renamed without changes.
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