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

[Feature]: refresh_all_continuous_aggregates #7525

Open
salisbury-espinosa opened this issue Dec 9, 2024 · 0 comments
Open

[Feature]: refresh_all_continuous_aggregates #7525

salisbury-espinosa opened this issue Dec 9, 2024 · 0 comments
Labels
feature-request Feature proposal

Comments

@salisbury-espinosa
Copy link

salisbury-espinosa commented Dec 9, 2024

What problem does the new feature solve?

CREATE OR REPLACE PROCEDURE "refresh_all_continuous_aggregates"() 
    LANGUAGE PLPGSQL 
    AS $$
    DECLARE
        "view_name_current" name;
        "view_name_list" name[];
    BEGIN
        "view_name_list" := ARRAY(
                SELECT 
                  "view_name"  
                FROM 
                  "timescaledb_information"."continuous_aggregates"
            );
        FOREACH "view_name_current" IN ARRAY "view_name_list" LOOP
          RAISE info 'refresh_continuous_aggregate for %', "view_name_current";
          CALL refresh_continuous_aggregate(
            format('"%s"', "view_name_current")::REGCLASS, 
            window_start := '-infinity'::timestamptz, 
            window_end := now() 
          );
        END LOOP;
    END;$$;

What does the feature do?

refresh all continuous aggregates

@salisbury-espinosa salisbury-espinosa added the feature-request Feature proposal label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Feature proposal
Projects
None yet
Development

No branches or pull requests

1 participant