3 ms·
Depends what you mean by editable. Even though a materialized view may not be editable, many of its underlying values may be, and that's the root cause of the p
by antonvs 3y ago
Depends what you mean by editable. Even though a materialized view may not be editable, many of its underlying values may be, and that's the root cause of the problem with denormalization.
Denormalized data effectively involves caching some source value in a durable way. As the saying tells us, cache invalidation is one of the two hard problems in computer science.
Of course in the denormalized DB context, detecting invalidation is typically simple: it's assumed to occur as soon as an update of a denormalized value occurs somewhere. At that point you may need an ACID update of all "cached" values, which is conceptually and computationally expensive. In the materialized view case, you may not do an update, but then you have an out of date cache.
So, we do see the effects of denormalization in a materialized view, but the pros and cons are a little different than in the case where data is stored in a primary table.
- taeric 3y agoI mean editable in the view. That you may have to cascade an edit out, makes sense. But, that fits how things are physically, too. Any store that puts prices on items will have a similar physical constraint that they are under.