Continuous Queries
Write SQL queries that run continuously, updating results as new data arrives. RisingWave turns standard SQL into persistent, always-on computations — delivering fresh answers in milliseconds instead of waiting for batch refreshes.
How They Differ
Continuous queries are SQL statements that run persistently, incrementally updating their results as new data streams in. Unlike batch queries that scan entire datasets on demand, continuous queries process only changed data and maintain always-fresh results — turning minutes or hours of latency into milliseconds.
| Aspect | Batch Query | Continuous Query |
|---|---|---|
| Execution | Runs once on demand | Runs persistently |
| Freshness | Stale until re-run | Always up-to-date |
| Processing | Full dataset scan | Incremental updates only |
| Latency | Minutes to hours | Milliseconds |
| Resource Use | Spikes during execution | Steady, proportional to change rate |
| Trigger | Manual or scheduled | Automatic on data arrival |
How It Works
RisingWave accepts standard PostgreSQL-compatible SQL and converts it into a distributed streaming dataflow. Each CREATE MATERIALIZED VIEW statement becomes a continuous query that incrementally maintains its results. Engineers use familiar SQL syntax while RisingWave handles the complexity of distributed incremental computation.
Only processes changed rows instead of rescanning entire tables, delivering sub-second freshness at minimal cost.
Queries are automatically parallelized across nodes with shared-nothing architecture for horizontal scalability.
Materialized view results are stored and directly queryable via standard SQL — no separate serving layer needed.
JOINs, aggregations, window functions, subqueries, and CTEs all work as continuous queries out of the box.
Patterns
Continuous queries excel at real-time aggregations, streaming joins, live dashboards, and event-driven alerts. Any workload where freshness matters and data arrives continuously benefits from the always-on computation model. RisingWave makes these patterns accessible through standard SQL without specialized streaming APIs.
Start writing always-on SQL queries in minutes.
Start Building Continuous Queries