I'd probably love to have the "REFRESH ON COMMIT"-feature for materialized views, to refresh (only the) impacted rows automatically whenever rows of the source table(s) change :)
We've had success using DBT incremental models for this. Deletes aren't supported though, but for our use case that's fine and do a nighly refresh on the whole.
16 comments
[ 0.22 ms ] story [ 46.2 ms ] threadWould benefit from putting "2021" in the title
Latest Releases 2023-08-10 - PostgreSQL 15.4, 14.9, 13.12, 12.16, 11.21, and PostgreSQL 16 Beta 3 Released!
https://news.ycombinator.com/item?id=29163319
(the same like in Oracle - https://docs.oracle.com/en/database/oracle/oracle-database/1... - but I would not need the fancy "query rewrite" feature that make SQLs use the matView even if they don't explicitly mention it in their SQL)
https://github.com/sraoss/pg_ivm
Lots and lots of theory about how to do this correctly.
I authored a project to do this with triggers. https://github.com/rivethealth/denorm
Otherwise the best alternative would be something like https://materialize.com
https://medium.com/cognite/postgres-can-do-that-f221a8046e
One tiny thing I discovered which I use a surprising amount is `table <tablename>;` is equivalent to `select * from <tablename>;`.
`watch` is the coolest Postgres feature that I've discovered recently.