-
Notifications
You must be signed in to change notification settings - Fork 906
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
Read watermark from materialized data #6405
Read watermark from materialized data #6405
Conversation
7230cf2
to
ba8bfd5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6405 +/- ##
==========================================
- Coverage 87.33% 87.32% -0.02%
==========================================
Files 187 187
Lines 41820 41768 -52
Branches 9313 9291 -22
==========================================
- Hits 36525 36472 -53
+ Misses 3623 3619 -4
- Partials 1672 1677 +5 ☔ View full report in Codecov by Sentry. |
ba8bfd5
to
0cdad42
Compare
@akuzm, @nikkhils: please review this pull request.
|
0cdad42
to
02606b9
Compare
02606b9
to
97a1176
Compare
Simple BenchmarkSchemaCREATE TABLE conditions(
time timestamp with time zone NOT NULL,
device_id INTEGER,
temperature FLOAT,
humidity FLOAT
);
SELECT * FROM create_hypertable('conditions', 'time', chunk_time_interval => '1 hour'::interval);
INSERT INTO conditions
SELECT time, (random()*3 + 1)::int, random()*80 - 40, random()*100
FROM generate_series(now() - INTERVAL '2 years', now(), '1 minute') AS time;
CREATE MATERIALIZED VIEW cagg WITH (timescaledb.continuous) AS
SELECT time_bucket('1 hour', "time"), device_id, AVG(temperature) AS avg_temp, AVG(humidity) AS avg_hum
FROM conditions
GROUP BY 1, 2
WITH NO DATA; Refresh on
|
8336b9f
to
65419d0
Compare
In 38fcd1b we improved the cagg_watermark performance by storing it into a metadata table and update it during the refresh. But we made a minor mistake here reading the watermark from the partial view instead of the already materialized data that should be much fast because we're reading already aggregated data. Fixed this mistake by reading the watermark from the underlying materialization hypertable (already aggregated data).
65419d0
to
0e12772
Compare
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * timescale#6365 Use numrows_pre_compression in approximate row count * timescale#6377 Use processed group clauses in PG16 * timescale#6384 Change bgw_log_level to use PGC_SUSET * timescale#6393 Disable vectorized sum for expressions. * timescale#6405 Read CAgg watermark from materialized data * timescale#6408 Fix groupby pathkeys for gapfill in PG16 * timescale#6428 Fix index matching during DML decompression * timescale#6439 Fix compressed chunk permission handling on PG16 * timescale#6443 Fix lost concurrent CAgg updates * timescale#6454 Fix unique expression indexes on compressed chunks * timescale#6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
This release contains bug fixes since the 2.13.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * #6365 Use numrows_pre_compression in approximate row count * #6377 Use processed group clauses in PG16 * #6384 Change bgw_log_level to use PGC_SUSET * #6393 Disable vectorized sum for expressions. * #6405 Read CAgg watermark from materialized data * #6408 Fix groupby pathkeys for gapfill in PG16 * #6428 Fix index matching during DML decompression * #6439 Fix compressed chunk permission handling on PG16 * #6443 Fix lost concurrent CAgg updates * #6454 Fix unique expression indexes on compressed chunks * #6465 Fix use of freed path in decompression sort logic **Thanks** * @MA-MacDonald for reporting an issue with gapfill in PG16 * @aarondglover for reporting an issue with unique expression indexes on compressed chunks * @adriangb for reporting an issue with security barrier views on pg16
In 38fcd1b we improved the cagg_watermark performance by storing it into a metadata table and update it during the refresh.
But we made a minor mistake here reading the watermark from the partial view instead of the already materialized data that should be much fast because we're reading already aggregated data.
Fixed this mistake by reading the watermark from the underlying materialization hypertable (already aggregated data).
Disable-check: force-changelog-file