-
Notifications
You must be signed in to change notification settings - Fork 887
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
Refactor continuous aggregate materialization code #7505
Refactor continuous aggregate materialization code #7505
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7505 +/- ##
==========================================
+ Coverage 80.06% 82.19% +2.12%
==========================================
Files 190 230 +40
Lines 37181 43250 +6069
Branches 9450 10875 +1425
==========================================
+ Hits 29770 35548 +5778
- Misses 2997 3385 +388
+ Partials 4414 4317 -97 ☔ View full report in Codecov by Sentry. |
6e70ed9
to
4c47fdb
Compare
@akuzm, @gayyappan: please review this pull request.
|
64bc413
to
94cdd5b
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.
Would suggest that you modify the way plans are prepared as outlined below. Also one bug that will cause problems later (a missing "volatile"). Also a bunch of nits. but that is entirely your decision if you want to use them.
You might also switch to use function pointers and a dispatch table, which probably makes the code a little easier to maintain and also make it a little faster, but that is optional.
94cdd5b
to
67a0e4c
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.
A few comments, but nothing critical, so approving.
da55567
to
c0e6efc
Compare
In addition to the code reorganization and simplification we changed it by splitting the query execution in multiple steps taking advantage of `SPI_prepare`, `SPI_execute_plan` and `SPI_freeplan`: * create_materialization_plan(PlanType) * execute_materialization_plan(PlanType) * free_materialization_plan(PlanType) This PR is in preparation for a following PR to execute the materialization in small batches to alleviate the I/O spikes when reading and writing many buckets.
c0e6efc
to
050c9e4
Compare
In timescale#7505 we used PG_TRY() .. PG_FINALLY() but some CI configurations was not happy with it reporting "variable might be clobbered by longjmp". Fixed it by using PG_TRY() .. PG_CATCH() instead. https://github.com/timescale/timescaledb/actions/runs/12277548387/job/34257269473#step:13:206
In #7505 we used PG_TRY() .. PG_FINALLY() but some CI configurations was not happy with it reporting "variable might be clobbered by longjmp". Fixed it by using PG_TRY() .. PG_CATCH() instead. https://github.com/timescale/timescaledb/actions/runs/12277548387/job/34257269473#step:13:206 Disable-check: force-changelog-file
Refactor continuous aggregate materialization code
In addition to the code reorganization and simplification we changed it by splitting the query execution in multiple steps taking advantage of
SPI_prepare
,SPI_execute_plan
andSPI_freeplan
:This PR is in preparation for a following PR to execute the materialization in small batches to alleviate the I/O spikes when reading and writing many buckets.
Disable-check: force-changelog-file