@@ -7,25 +7,37 @@ description:
77
88::: info
99
10- Materialized View support is now generally available (GA) and ready for production use.
10+ Materialized View support is now generally available (GA) and ready for
11+ production use.
1112
12- If you are using versions earlier than ` 8.3.1 ` , we suggest you upgrade at your earliest convenience.
13+ If you are using versions earlier than ` 8.3.1 ` , we suggest you upgrade at your
14+ earliest convenience.
1315
1416:::
1517
1618` REFRESH MATERIALIZED VIEW ` refreshes a materialized view. This is helpful when
1719a view becomes invalid, and no longer refreshes incrementally.
1820
19- When the FULL keyword is specified, this command deletes the data in the target
20- materialized view and inserts the results of the query into the view. It also
21- marks the materialized view as valid, reactivating the incremental refresh
21+ When the ` FULL ` keyword is specified, this command deletes the data in the
22+ target materialized view and inserts the results of the query into the view. It
23+ also marks the materialized view as valid, reactivating the incremental refresh
2224processes.
2325
2426When the ` INCREMENTAL ` keyword is used, the ` REFRESH ` command schedules an
2527incremental refresh of the materialized view. Usually, incremental refresh is
2628automatic, so this command is useful only in niche situations when incremental
2729refresh is not working as expected, but the view is still valid.
2830
31+ When the ` INTERVAL ` keyword is specified, this command refreshes the data in the
32+ specified time interval only. This command is useful for a valid materialized
33+ view with configured
34+ [ ` REFRESH LIMIT ` ] ( /docs/reference/sql/alter-mat-view-set-refresh-limit/ ) . That's
35+ because inserted base table rows with timestamps older than the refresh limit
36+ are ignored by incremental refresh, so interval refresh may be used to
37+ recalculate materialized view on older rows. Interval refresh does not affect
38+ incremental refresh, e.g. it does not update the last base table transaction
39+ used by incremental refresh.
40+
2941## Syntax
3042
3143![ Flow chart showing the syntax of the REFRESH MATERIALIZED VIEW keyword] ( /images/docs/diagrams/refreshMatView.svg )
@@ -40,6 +52,10 @@ REFRESH MATERIALIZED VIEW trades_1h FULL;
4052REFRESH MATERIALIZED VIEW trades_1h INCREMENTAL;
4153```
4254
55+ ``` questdb-sql
56+ REFRESH MATERIALIZED VIEW trades_1h INTERVAL FROM '2025-05-05T01:00:00.000000Z' TO '2025-05-05T02:00:00.000000Z';
57+ ```
58+
4359## See also
4460
4561For more information on the concept, see the the
0 commit comments