https://www.postgresql.org/docs/14/functions-window.html for DB Version 14
Calculating Changes in Values over Time
Add an auto-incrementing integer to a View
(or the last day in a month): https://database.guide/get-the-last-day-of-the-month-in-postgresql/
postgres update a date field when a boolean field is set to true
A materialized view is a database object that stores the result of a precomputed query. Unlike regular views, which are virtual and don't store data themselves, materialized views physically store the query result, allowing for faster access to the data. Materialized views are especially useful in scenarios where the underlying data is relatively stable, and the cost of running complex queries in real-time is high.