4 ms·
Views, especially Materialized Views if you’re on Postgres, are about as close as you can come to a “one neat trick that solves all your problems” in modern sof
by kiernanmcgowan 4y ago
Views, especially Materialized Views if you’re on Postgres, are about as close as you can come to a “one neat trick that solves all your problems” in modern software development imo.
- remus 4y agoI'd love to use materialised views more often but my experience is that they're full of annoying limitations, typically around functions that feel like they should be immutable but aren't.
- kiernanmcgowan 4y agoRight, I think the timestamp with timezone type is a great example of one of these short comings. I’ve generally used it as a step in a data pipeline, where some intermittent state or aggregation where being stale/stable for a period of time is ok. Did this recently for a daily trends report on some news data - live querying the data is slow, but baking it off into a MV makes it much faster and keeps the query result from changing too rapidly to new data.
- ttfkam 4y agoMaterialized views + pg_cron = chef's kiss for simple yet performant report generation.