The Way for Updating Materialized Views Rapidly
summary
A PostgreSQL patch implements Incremental View Maintenance via a new CREATE INCREMENTAL MATERIALIZED VIEW syntax, using AFTER triggers and transition tables to extract table deltas, rewriting the view query to compute deltas, and applying changes with SQL. It already supports count/sum/avg/max (hidden columns for multiplicity), self-joins, outer joins and EXISTS-style subqueries. Measured on TPCH-like data a full REFRESH takes ~24 seconds while the incremental update applies in ~22 milliseconds (~1000x faster). Limitations include window functions, complex subqueries, user aggregates, and some outer-join/aggregate combinations; patch is on pgsql-hackers/GitHub.
AI-written summary · about
