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

Mark cagg_watermark parallel safe #5240

Merged

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented Jan 27, 2023

The cagg_watermark function perform just read-only operations so is
safe to make it parallel safe to take advantage of the Postgres
parallel query.

Since 2.7 when we introduced the new Continuous Aggregate format we
don't use partials anymore and those aggregate functions
partialize_agg and finalize_agg are not parallel safe, so make no
sense don't take advantage of Postgres parallel query for realtime
Continuous Aggregates.

Disable-Check: force-changelog-changed

Related to #4699

@fabriziomello fabriziomello self-assigned this Jan 27, 2023
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #5240 (6543fae) into main (e6173d1) will increase coverage by 25.89%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #5240       +/-   ##
===========================================
+ Coverage   63.10%   89.00%   +25.89%     
===========================================
  Files         225      225               
  Lines       45666    51821     +6155     
===========================================
+ Hits        28818    46123    +17305     
+ Misses      16848     5698    -11150     
Impacted Files Coverage Δ
src/ts_catalog/continuous_agg.c 94.80% <ø> (+74.14%) ⬆️
tsl/test/src/remote/scan_exec_debug.c 71.42% <0.00%> (-11.91%) ⬇️
tsl/test/src/test_chunk_stats.c 92.59% <0.00%> (-7.41%) ⬇️
src/uuid.c 78.57% <0.00%> (-6.05%) ⬇️
src/histogram.c 83.83% <0.00%> (-4.80%) ⬇️
tsl/src/fdw/fdw_utils.c 80.76% <0.00%> (-4.65%) ⬇️
src/time_utils.c 93.72% <0.00%> (-3.78%) ⬇️
src/time_bucket.c 95.81% <0.00%> (-2.76%) ⬇️
src/hypertable_cache.c 93.25% <0.00%> (-2.64%) ⬇️
tsl/src/dist_backup.c 92.30% <0.00%> (-2.52%) ⬇️
... and 202 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6173d1...6543fae. Read the comment docs.

@fabriziomello fabriziomello force-pushed the mark_cagg_watermark_parallel_safe branch 4 times, most recently from a9e56d7 to fc8c12f Compare January 30, 2023 20:11
@fabriziomello fabriziomello added continuous_aggregate enhancement An enhancement to an existing feature for functionality Team: Core Database core labels Jan 30, 2023
@fabriziomello fabriziomello marked this pull request as ready for review January 30, 2023 20:32
@github-actions
Copy link

@lkshminarayanan, @akuzm: please review this pull request.

Powered by pull-review

Copy link
Member

@akuzm akuzm left a comment

Choose a reason for hiding this comment

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

Good idea to mark it parallel safe.

sql/util_time.sql Outdated Show resolved Hide resolved
src/ts_catalog/continuous_agg.c Outdated Show resolved Hide resolved
tsl/test/expected/continuous_aggs-12.out Outdated Show resolved Hide resolved
tsl/test/sql/continuous_aggs.sql.in Outdated Show resolved Hide resolved
The `cagg_watermark` function perform just read-only operations so is
safe to make it parallel safe to take advantage of the Postgres
parallel query.

Since 2.7 when we introduced the new Continuous Aggregate format we
don't use partials anymore and those aggregate functions
`partialize_agg` and `finalize_agg` are not parallel safe, so make no
sense don't take advantage of Postgres parallel query for realtime
Continuous Aggregates.
@fabriziomello fabriziomello force-pushed the mark_cagg_watermark_parallel_safe branch from fc8c12f to 6543fae Compare January 31, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous_aggregate core enhancement An enhancement to an existing feature for functionality Team: Core Database
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants