-
Notifications
You must be signed in to change notification settings - Fork 881
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
Drop chunks from materialized hypertables #1666
Conversation
4486112
to
992d4f4
Compare
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.
please add to CHANGELOG.md
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.
I am approving, but I am not convinced that this is the right approach. Still, I assume this can be refined later.
src/chunk.c
Outdated
@@ -2413,9 +2419,18 @@ ts_chunk_do_drop_chunks(Oid table_relid, Datum older_than_datum, Datum newer_tha | |||
switch (ts_continuous_agg_hypertable_status(hypertable_id)) | |||
{ | |||
case HypertableIsMaterialization: | |||
if (user_supplied_table_name == false) | |||
{ | |||
elog(ERROR, "cannot drop_chunks on a continuous aggregate materialization table"); |
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.
elog(ERROR, "cannot drop_chunks on a continuous aggregate materialization table"); | |
elog(ERROR, "cannot drop chunks on a continuous aggregate materialization table"); |
src/chunk.c
Outdated
pg_unreachable(); | ||
if (user_supplied_table_name == false) | ||
{ | ||
elog(ERROR, "cannot drop_chunks on a continuous aggregate materialization table"); |
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.
elog(ERROR, "cannot drop_chunks on a continuous aggregate materialization table"); | |
elog(ERROR, "cannot drop chunks on a continuous aggregate materialization table"); |
992d4f4
to
4aec297
Compare
1b86324
to
45887a7
Compare
Codecov Report
@@ Coverage Diff @@
## master #1666 +/- ##
==========================================
+ Coverage 91.52% 91.88% +0.36%
==========================================
Files 144 142 -2
Lines 21874 21034 -840
==========================================
- Hits 20020 19327 -693
+ Misses 1854 1707 -147
Continue to review full report at Codecov.
|
45887a7
to
7642f24
Compare
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.
Mostly nits.
I suggest leaving the question of API changes (not allowing wildcards) for later since this is a breaking API change.
src/chunk.c
Outdated
if (ca == NULL) | ||
ereport(ERROR, | ||
(errcode(ERRCODE_TS_HYPERTABLE_NOT_EXIST), | ||
errmsg("hypertable \"%s\" does not exist", NameStr(*table_name)))); |
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.
I guess this error is a bit confusing in case one passed in the view name. I suggest updating the error to say something like: errmsg("%s is not a hypertable or continuous aggregate view")
errhint("It is only possible to drop chunks on a user-created hypertable or continuous aggregate view.")
src/chunk.c
Outdated
ht_oids = ts_hypertable_get_all_by_name(schema_name, table_name, CurrentMemoryContext); | ||
|
||
if (table_name != NULL) | ||
{ | ||
ContinuousAgg *ca = NULL; |
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.
Move declaration inside the local context where it is used.
@@ -783,3 +783,51 @@ ts_continuous_agg_get_user_view_oid(ContinuousAgg *agg) | |||
elog(ERROR, "could not find user view for continuous agg"); | |||
return view_relid; | |||
} | |||
static int32 |
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.
Add newline
tsl/src/bgw_policy/drop_chunks_api.c
Outdated
{ | ||
ereport(ERROR, | ||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), | ||
errmsg("cannot add drop chunks policy to materialized hypertables \"%s\" ", |
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.
errmsg("cannot add drop chunks policy to materialized hypertables \"%s\" ", | |
errmsg("cannot add drop chunks policy to materialized hypertable \"%s\" ", |
open_dim = hyperspace_get_open_dimension(meta->ht->space, 0); | ||
partitioning_type = ts_dimension_get_partition_type(open_dim); | ||
if (IS_INTEGER_TYPE(partitioning_type)) | ||
{ |
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.
elide braces
|
||
open_dim = ts_continous_agg_find_integer_now_func_by_materialization_id(mat_id); | ||
if (open_dim == NULL) | ||
{ |
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.
elide braces
@@ -1048,3 +1045,36 @@ ORDER BY ranges; | |||
_timescaledb_internal._hyper_13_22_chunk | {"[20,40)"} | |||
(1 row) | |||
|
|||
-- TEST drop chunks from continuous aggregates by specifying view name | |||
SELECT drop_chunks( | |||
table_name => 'drop_chunks_view', |
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.
Same here as above. What is the behavior of cascade_to_materializations = true
when drop_chunks
is called on the view?
Do we need to test?
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 are no dependencies on this view/materialized hypertable. But I will add a contrived case and test. This would help when we extend functionality to create views based on existing views (like 1 day view based on 1 hour view).
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.
Update: contrived case doesn't work as we disable cont. aggregates based on existing cont. aggregates.
7642f24
to
de01157
Compare
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.
Approving, but suggest applying the fixes to the error messages to make them more human readable and consistent.
71fc8a8
to
5a34e6c
Compare
src/chunk.c
Outdated
{ | ||
/* default schema is public */ | ||
schema_name = (NameData *) palloc0(NAMEDATALEN); | ||
namestrcpy(schema_name, "public"); |
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.
the schema shouldnt be hardcoded like that and you should call current_schema to get default schema instead
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.
The behavior described in the docs is that we will only look for "public" schema if it is not specified explicitly. We were missing this check earlier.
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.
i think you shouldnt hardcode the default schema to "public"
5a34e6c
to
c484299
Compare
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.
Looks good, just a couple of non-important minors
@@ -2413,9 +2416,18 @@ ts_chunk_do_drop_chunks(Oid table_relid, Datum older_than_datum, Datum newer_tha | |||
switch (ts_continuous_agg_hypertable_status(hypertable_id)) | |||
{ | |||
case HypertableIsMaterialization: | |||
if (user_supplied_table_name == false) |
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.
Just nit, I guess those two cases can be combined together to avoid having error message duplication, like this:
case HypertableIsMaterialization:
case HypertableIsMaterializationAndRaw:
if (user_supplied_table_name == false)
elog(ERROR, "cannot drop chunks on a continuous aggregate materialization table");
has_continuous_aggs = (status == HypertableIsMaterializationAndRaw);
break;
htid = form->raw_hypertable_id; | ||
count++; | ||
} | ||
Assert(count <= 1); |
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.
Maybe just do Assert(htid == INVALID_HYPERTABLE_ID)
instead of count when assigning htid
. In case if Assert is disabled, we might get compiler warning saying that count is set but not used.
ContinuousAgg *ca = NULL; | ||
ca = ts_continuous_agg_find_by_view_name(NameStr(*schema_name), NameStr(*table_name)); | ||
if (ca == NULL) | ||
ereport(ERROR, |
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.
Just noticed that sometimes we are using elog(ERROR)
and sometimes ereport(ERROR)
here, maybe we should stick to one of them, unless there is a good reason for it
res = DatumGetInt64(now) - interval; | ||
if (res > DatumGetInt64(now)) | ||
{ | ||
bool overflow = pg_sub_s64_overflow(DatumGetInt64(now), interval, &res); |
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.
Do we still need to put blank line after a variable definition?
older_than_type, | ||
"older_than", | ||
"add_drop_chunks_policy"); | ||
hcache = ts_hypertable_cache_pin(); |
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.
Do we need to unpin the cache after usage in this function?
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.
not needed as cache gets unpinned automatically at end of txn.
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.
Seems to be released already.
Generally, though, probably good practice to have explicit unpins/releases to avoid holding on to memory longer than necessary.
809ad58
to
94801eb
Compare
94801eb
to
67ab865
Compare
Can you add a test where a hypertable with the same name exists in schema a and schema b which are both in search path |
90387c1
to
4cb5b0c
Compare
Add support for dropping chunks from materialized hypertables. drop_chunks_policy can now be set up for materialized hypertables.
4cb5b0c
to
c77780b
Compare
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @dark048 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @dark048 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **Major Features** **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database before running `ALTER EXTENSION` **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database before running `ALTER EXTENSION` **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * timescale#1666 Support drop_chunks API for continuous aggregates * timescale#1711 Change log level for continuous aggregate materialization messages **Bugfixes** * timescale#1630 Print notice for COPY TO on hypertable * timescale#1648 Drop chunks from materialized hypertable * timescale#1668 Cannot add dimension if hypertable has empty chunks * timescale#1673 Fix crash when interrupting create_hypertable * timescale#1674 Fix time_bucket_gapfill's interaction with GROUP BY * timescale#1686 Fix order by queries on compressed hypertables that have char segment by column * timescale#1687 Fix issue with disabling compression when foreign keys are present * timescale#1688 Handle many BGW jobs better * timescale#1698 Add logic to ignore dropped chunks in hypertable_relation_size * timescale#1704 Fix bad plan for continuous aggregate materialization * timescale#1709 Prevent starting background workers with NOLOGIN * timescale#1713 Fix miscellaneous background worker issues * timescale#1715 Fix issue with overly aggressive chunk exclusion in outer joins * timescale#1719 Fix restoring/scheduler entrypoint to avoid BGW death * timescale#1720 Add scheduler cache invalidations * timescale#1727 Fix compressing INTERVAL columns * timescale#1728 Handle Sort nodes in ConstraintAwareAppend * timescale#1730 Fix partial index handling on hypertables * timescale#1739 Use release OpenSSL DLLs for debug builds on Windows * timescale#1740 Fix invalidation entries from multiple caggs on same hypertable * timescale#1743 Fix continuous aggregate materialization timezone handling * timescale#1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * #1666 Support drop_chunks API for continuous aggregates * #1711 Change log level for continuous aggregate materialization messages **Bugfixes** * #1630 Print notice for COPY TO on hypertable * #1648 Drop chunks from materialized hypertable * #1668 Cannot add dimension if hypertable has empty chunks * #1673 Fix crash when interrupting create_hypertable * #1674 Fix time_bucket_gapfill's interaction with GROUP BY * #1686 Fix order by queries on compressed hypertables that have char segment by column * #1687 Fix issue with disabling compression when foreign keys are present * #1688 Handle many BGW jobs better * #1698 Add logic to ignore dropped chunks in hypertable_relation_size * #1704 Fix bad plan for continuous aggregate materialization * #1709 Prevent starting background workers with NOLOGIN * #1713 Fix miscellaneous background worker issues * #1715 Fix issue with overly aggressive chunk exclusion in outer joins * #1719 Fix restoring/scheduler entrypoint to avoid BGW death * #1720 Add scheduler cache invalidations * #1727 Fix compressing INTERVAL columns * #1728 Handle Sort nodes in ConstraintAwareAppend * #1730 Fix partial index handling on hypertables * #1739 Use release OpenSSL DLLs for debug builds on Windows * #1740 Fix invalidation entries from multiple caggs on same hypertable * #1743 Fix continuous aggregate materialization timezone handling * #1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * #1666 Support drop_chunks API for continuous aggregates * #1711 Change log level for continuous aggregate materialization messages **Bugfixes** * #1630 Print notice for COPY TO on hypertable * #1648 Drop chunks from materialized hypertable * #1668 Cannot add dimension if hypertable has empty chunks * #1673 Fix crash when interrupting create_hypertable * #1674 Fix time_bucket_gapfill's interaction with GROUP BY * #1686 Fix order by queries on compressed hypertables that have char segment by column * #1687 Fix issue with disabling compression when foreign keys are present * #1688 Handle many BGW jobs better * #1698 Add logic to ignore dropped chunks in hypertable_relation_size * #1704 Fix bad plan for continuous aggregate materialization * #1709 Prevent starting background workers with NOLOGIN * #1713 Fix miscellaneous background worker issues * #1715 Fix issue with overly aggressive chunk exclusion in outer joins * #1719 Fix restoring/scheduler entrypoint to avoid BGW death * #1720 Add scheduler cache invalidations * #1727 Fix compressing INTERVAL columns * #1728 Handle Sort nodes in ConstraintAwareAppend * #1730 Fix partial index handling on hypertables * #1739 Use release OpenSSL DLLs for debug builds on Windows * #1740 Fix invalidation entries from multiple caggs on same hypertable * #1743 Fix continuous aggregate materialization timezone handling * #1748 Fix remove_drop_chunks_policy for continuous aggregates **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * #1666 Support drop_chunks API for continuous aggregates * #1711 Change log level for continuous aggregate materialization messages **Bugfixes** * #1630 Print notice for COPY TO on hypertable * #1648 Drop chunks from materialized hypertable * #1668 Cannot add dimension if hypertable has empty chunks * #1673 Fix crash when interrupting create_hypertable * #1674 Fix time_bucket_gapfill's interaction with GROUP BY * #1686 Fix order by queries on compressed hypertables that have char segment by column * #1687 Fix issue with disabling compression when foreign keys are present * #1688 Handle many BGW jobs better * #1698 Add logic to ignore dropped chunks in hypertable_relation_size * #1704 Fix bad plan for continuous aggregate materialization * #1709 Prevent starting background workers with NOLOGIN * #1713 Fix miscellaneous background worker issues * #1715 Fix issue with overly aggressive chunk exclusion in outer joins * #1719 Fix restoring/scheduler entrypoint to avoid BGW death * #1720 Add scheduler cache invalidations * #1727 Fix compressing INTERVAL columns * #1728 Handle Sort nodes in ConstraintAwareAppend * #1730 Fix partial index handling on hypertables * #1739 Use release OpenSSL DLLs for debug builds on Windows * #1740 Fix invalidation entries from multiple caggs on same hypertable * #1743 Fix continuous aggregate materialization timezone handling * #1748 Fix remove_drop_chunks_policy for continuous aggregates * #1756 Fix handling of dropped chunks in compression background worker **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * #1666 Support drop_chunks API for continuous aggregates * #1711 Change log level for continuous aggregate materialization messages **Bugfixes** * #1630 Print notice for COPY TO on hypertable * #1648 Drop chunks from materialized hypertable * #1668 Cannot add dimension if hypertable has empty chunks * #1673 Fix crash when interrupting create_hypertable * #1674 Fix time_bucket_gapfill's interaction with GROUP BY * #1686 Fix order by queries on compressed hypertables that have char segment by column * #1687 Fix issue with disabling compression when foreign keys are present * #1688 Handle many BGW jobs better * #1698 Add logic to ignore dropped chunks in hypertable_relation_size * #1704 Fix bad plan for continuous aggregate materialization * #1709 Prevent starting background workers with NOLOGIN * #1713 Fix miscellaneous background worker issues * #1715 Fix issue with overly aggressive chunk exclusion in outer joins * #1719 Fix restoring/scheduler entrypoint to avoid BGW death * #1720 Add scheduler cache invalidations * #1727 Fix compressing INTERVAL columns * #1728 Handle Sort nodes in ConstraintAwareAppend * #1730 Fix partial index handling on hypertables * #1739 Use release OpenSSL DLLs for debug builds on Windows * #1740 Fix invalidation entries from multiple caggs on same hypertable * #1743 Fix continuous aggregate materialization timezone handling * #1748 Fix remove_drop_chunks_policy for continuous aggregates * #1756 Fix handling of dropped chunks in compression background worker **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
This maintenance release contains bugfixes since the 1.6.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates, time_bucket_gapfill, partial index handling and drop_chunks. **For this release only**, you will need to restart the database after upgrade before restoring a backup. **Minor Features** * #1666 Support drop_chunks API for continuous aggregates * #1711 Change log level for continuous aggregate materialization messages **Bugfixes** * #1630 Print notice for COPY TO on hypertable * #1648 Drop chunks from materialized hypertable * #1668 Cannot add dimension if hypertable has empty chunks * #1673 Fix crash when interrupting create_hypertable * #1674 Fix time_bucket_gapfill's interaction with GROUP BY * #1686 Fix order by queries on compressed hypertables that have char segment by column * #1687 Fix issue with disabling compression when foreign keys are present * #1688 Handle many BGW jobs better * #1698 Add logic to ignore dropped chunks in hypertable_relation_size * #1704 Fix bad plan for continuous aggregate materialization * #1709 Prevent starting background workers with NOLOGIN * #1713 Fix miscellaneous background worker issues * #1715 Fix issue with overly aggressive chunk exclusion in outer joins * #1719 Fix restoring/scheduler entrypoint to avoid BGW death * #1720 Add scheduler cache invalidations * #1727 Fix compressing INTERVAL columns * #1728 Handle Sort nodes in ConstraintAwareAppend * #1730 Fix partial index handling on hypertables * #1739 Use release OpenSSL DLLs for debug builds on Windows * #1740 Fix invalidation entries from multiple caggs on same hypertable * #1743 Fix continuous aggregate materialization timezone handling * #1748 Fix remove_drop_chunks_policy for continuous aggregates * #1756 Fix handling of dropped chunks in compression background worker **Thanks** * @RJPhillips01 for reporting an issue with drop chunks. * @b4eEX for reporting an issue with disabling compression. * @darko408 for reporting an issue with order by on compressed hypertables * @mrechte for reporting an issue with compressing INTERVAL columns * @tstaehli for reporting an issue with ConstraintAwareAppend * @chadshowalter for reporting an issue with partial index on hypertables * @geoffreybennett for reporting an issue with create_hypertable when interrupting operations * @alxndrdude for reporting an issue with background workers during restore * @zcavaliero for reporting and fixing an issue with dropped columns in hypertable_relation_size * @ismailakpolat for reporting an issue with cagg materialization on hypertables with TIMESTAMP column
Add support for dropping chunks from materialized
hypertables. drop_chunks_policy can now be set up
for materialized hypertables.
Fixes #1639
Note to Reviewers:
This PR supports:
A. add_drop_chunks_policy( '<schema_name>.<view_name>' , ... )
cannot pass in materialized hypertable name directly here.
Policies are added by specifying the cont. aggregate view name.
If the cont. aggregate is based on "integer-type" time table, then the integer_now function is inherited by the cont. aggregate as well.
B. drop_chunks support for materialized hypertables.
The table_name/view_name is not specifically passed in.
This variant errors out if any materialization hypertable satisfies the criterion for older_than.
(see continuous_aggs_ddl.sql.in for the variants )
If the schema_name is not passed in, the "search_path" is used to determine the schemas that will be searched for tables matching the criterion.