Indexed Views
Typically, a view is a conceptual table only-it does not actually store any of the data it returns. It's a virtual table—you query it, and, behind the scenes, SQL Server runs its SELECT statement and returns the results. This is the way views have always worked on SQL Server.
Indexed views change this. By indexing a view you can materialize its result set permanently so that querying it in the future is much faster. Given a table with a large number of rows and a view over it that only returns a few of them, the difference an index over the view could make in execution time may well be dramatic.
As with partitioned views, there are a number of restrictions on the types of views that may be indexed. You can read up on these in the ...
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