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

Improve Realtime Continuous Aggregate performance #5261

Merged

Commits on Mar 22, 2023

  1. Improve Realtime Continuous Aggregate performance

    When calling the `cagg_watermark` function to get the watermark of a
    Continuous Aggregate we execute a `SELECT MAX(time_dimension)` query
    in the underlying materialization hypertable.
    
    The problem is that a `SELECT MAX(time_dimention)` query can be
    expensive because it will scan all hypertable chunks increasing the
    planning time for a Realtime Continuous Aggregates.
    
    Improved it by creating a new catalog table to serve as a cache table
    to store the current Continous Aggregate watermark in the following
    situations:
    - Create CAgg: store the minimum value of hypertable time dimension
      data type;
    - Refresh CAgg: store the last value of the time dimension materialized
      in the underlying materialization hypertable (or the minimum value of
      materialization hypertable time dimension data type if there's no
      data materialized);
    - Drop CAgg Chunks: the same as refresh cagg.
    
    Closes timescale#4699, timescale#5307
    fabriziomello committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    db35aa2 View commit details
    Browse the repository at this point in the history