Designing Modular Indexed Views
Because of the many restrictions on indexed views (no unions, no outer joins, no aggregates other than SUM() and COUNT_BIG(), and so on), you won't find a lot of complex queries that you can cover completely with a single indexed view. However, you will likely find many simpler ones—aggregations and joins that your code repeats often—and this is where the best use of indexed views comes in: modular preprocessing. Indexed views are best suited to simpler queries that take a considerable amount of time to run because of the amount of data they traverse. By materializing the result sets that are produced by these queries, you create the possibility that the optimizer may use an indexed view to avoid having to reproduce ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access