From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Enhance view performance

Enhance view performance

- [Instructor] Views typically act as virtual tables in that they don't store any values, only the instructions for how to gather and assemble the requested information from the underlying source data tables. That means that every time you query a view, SQL Server goes back to the data tables and reprocesses the information in order to display the results. While this process is efficient from a data storage perspective, it can sometimes be a slow process to search through all of those underlying tables every time. One solution is to create something called an indexed view. Index views actually store or persist their own copy of the data to disk. Every time a change is made to one of the underlying tables, SQL Server updates the index view's copy so that it's always up-to-date. By doing so, the view is essentially pre-baked and ready to serve at a moment's notice. In the enterprise edition of SQL Server, the query…

Contents