29.6 Indexes on Materialized Views for Fast Reads
Right, so you’ve built a materialized view. Congratulations, you’ve essentially told your database, “I’m tired of you recalculating this complex join every five minutes; just save the answer to a table and let me read from that.” It’s a brilliant move for read performance. But here’s the thing: a materialized view is, at its core, a table. And what do we do with tables that we query heavily? We index them. Leaving a materialized view unindexed is like buying a sports car and then putting cheap, bald tires on it. You’re not getting the performance you paid for with all that expensive REFRESH computation.