{"id":906,"date":"2018-10-13T17:34:38","date_gmt":"2018-10-13T10:34:38","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=906"},"modified":"2020-07-11T03:29:02","modified_gmt":"2020-07-10T20:29:02","slug":"sql-server-indexed-view","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/","title":{"rendered":"SQL Server Indexed View"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to create a SQL Server indexed view that stored data physically in the database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-sql-server-indexed-view'>Introduction to SQL Server indexed view <a href=\"#introduction-to-sql-server-indexed-view\" class=\"anchor\" id=\"introduction-to-sql-server-indexed-view\" title=\"Anchor for Introduction to SQL Server indexed view\">#<\/a><\/h2>\n\n\n\n<p>Regular <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/\">SQL Server views<\/a> are the saved queries that provide some benefits such as query simplicity, business logic consistency, and security. However, they do not improve the underlying query performance.<\/p>\n\n\n\n<p>Unlike regular views, indexed views are materialized views that stores data physically like a table hence may provide some the performance benefit if they are used appropriately.<\/p>\n\n\n\n<p>To create an indexed view, you use the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/\">create a view<\/a> that uses the <code>WITH SCHEMABINDING<\/code> option which binds the view to the schema of the underlying tables.<\/li><li>Second, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-indexes\/sql-server-unique-index\/\">create a unique clustered index<\/a> on the view. This materializes the view.<\/li><\/ul>\n\n\n\n<p>Because of the <code>WITH SCHEMABINDING<\/code> option, if you want to change the structure of the underlying tables which affect the indexed view&#8217;s definition, you must <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-drop-view\/\">drop the indexed view<\/a> first before applying the changes.<\/p>\n\n\n\n<p>In addition, SQL Server requires all object references in an indexed view to include the two-part naming<br>\nconvention i.e., <code>schema.object<\/code>, and all referenced objects are in the same database.<\/p>\n\n\n\n<p>When the data of the underlying tables changes, the data in the indexed view is also automatically updated. This causes a write overhead for the referenced tables. It means that when you write to the underlying table, SQL Server also has to write to the index of the view. Therefore, you should only create an indexed view against the tables that have in-frequent data updates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='creating-an-sql-server-indexed-view-example'>Creating an SQL Server indexed view example <a href=\"#creating-an-sql-server-indexed-view-example\" class=\"anchor\" id=\"creating-an-sql-server-indexed-view-example\" title=\"Anchor for Creating an SQL Server indexed view example\">#<\/a><\/h2>\n\n\n\n<p>The following statement creates an indexed view based on columns of the <code>production.products<\/code>, <code>production.brands<\/code>, and <code>production.categories<\/code> tables from the <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-sample-database\/\">sample database<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"169\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png\" alt=\"Categories, Products, and Brands\" class=\"wp-image-144\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png 744w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands-300x68.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">VIEW<\/span> product_master\n<span class=\"hljs-keyword\">WITH<\/span> SCHEMABINDING\n<span class=\"hljs-keyword\">AS<\/span> \n<span class=\"hljs-keyword\">SELECT<\/span>\n    product_id,\n    product_name,\n    model_year,\n    list_price,\n    brand_name,\n    category_name\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> production.brands b \n    <span class=\"hljs-keyword\">ON<\/span> b.brand_id = p.brand_id\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> production.categories c \n    <span class=\"hljs-keyword\">ON<\/span> c.category_id = p.category_id;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Notice the option <code>WITH SCHEMABINDING<\/code> after the view name. The rest is the same as a regular view.<\/p>\n\n\n\n<p>Before creating a unique clustered index for the view, let&#8217;s examine the query I\/O cost statistics by querying data from a regular view and using the <code>SET STATISTICS IO<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SET<\/span> <span class=\"hljs-keyword\">STATISTICS<\/span> IO <span class=\"hljs-keyword\">ON<\/span>\n<span class=\"hljs-keyword\">GO<\/span>\n\n<span class=\"hljs-keyword\">SELECT<\/span> \n    * \n<span class=\"hljs-keyword\">FROM<\/span>\n    production.product_master\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    product_name;\nGO \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>SQL Server returns the following query I\/O cost statistics:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">Table <span class=\"hljs-string\">'Worktable'<\/span>. Scan count <span class=\"hljs-number\">0<\/span>, logical reads <span class=\"hljs-number\">0<\/span>, physical reads <span class=\"hljs-number\">0<\/span>, read-ahead reads <span class=\"hljs-number\">0<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span>\nTable <span class=\"hljs-string\">'Workfile'<\/span>. Scan count <span class=\"hljs-number\">0<\/span>, logical reads <span class=\"hljs-number\">0<\/span>, physical reads <span class=\"hljs-number\">0<\/span>, read-ahead reads <span class=\"hljs-number\">0<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span>\nTable <span class=\"hljs-string\">'products'<\/span>. Scan count <span class=\"hljs-number\">1<\/span>, logical reads <span class=\"hljs-number\">5<\/span>, physical reads <span class=\"hljs-number\">1<\/span>, read-ahead reads <span class=\"hljs-number\">3<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span>\nTable <span class=\"hljs-string\">'categories'<\/span>. Scan count <span class=\"hljs-number\">1<\/span>, logical reads <span class=\"hljs-number\">2<\/span>, physical reads <span class=\"hljs-number\">1<\/span>, read-ahead reads <span class=\"hljs-number\">0<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span>\nTable <span class=\"hljs-string\">'brands'<\/span>. Scan count <span class=\"hljs-number\">1<\/span>, logical reads <span class=\"hljs-number\">2<\/span>, physical reads <span class=\"hljs-number\">1<\/span>, read-ahead reads <span class=\"hljs-number\">0<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As you can see clearly from the output, SQL Server had to read from three corresponding tables before returning the result set.<\/p>\n\n\n\n<p>Let&#8217;s <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-indexes\/sql-server-unique-index\/\">add a unique clustered index<\/a> to the view:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">UNIQUE<\/span> CLUSTERED <span class=\"hljs-keyword\">INDEX<\/span> \n    ucidx_product_id \n<span class=\"hljs-keyword\">ON<\/span> production.product_master(product_id);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This statement materializes the view, making it have a physical existence in the database.<\/p>\n\n\n\n<p>You can also add a non-clustered index on the <code>product_name<\/code> column of the view:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> NONCLUSTERED <span class=\"hljs-keyword\">INDEX<\/span> \n    ucidx_product_name\n<span class=\"hljs-keyword\">ON<\/span> production.product_master(product_name);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, if you query data against the view, you will notice that the statistics have changed:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">Table <span class=\"hljs-string\">'Worktable'<\/span>. Scan count <span class=\"hljs-number\">0<\/span>, logical reads <span class=\"hljs-number\">0<\/span>, physical reads <span class=\"hljs-number\">0<\/span>, read-ahead reads <span class=\"hljs-number\">0<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span>\nTable <span class=\"hljs-string\">'product_master'<\/span>. Scan count <span class=\"hljs-number\">1<\/span>, logical reads <span class=\"hljs-number\">6<\/span>, physical reads <span class=\"hljs-number\">1<\/span>, read-ahead reads <span class=\"hljs-number\">11<\/span>, lob logical reads <span class=\"hljs-number\">0<\/span>, lob physical reads <span class=\"hljs-number\">0<\/span>, lob read-ahead reads <span class=\"hljs-number\">0.<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Instead of reading data from three tables, SQL Server now reads data directly from the materialized view <code>product_master<\/code>.<\/p>\n\n\n\n<p>Note that this feature is only available on SQL Server Enterprise Edition. If you use the SQL Server Standard or Developer Edition, you must use the <code>WITH (NOEXPAND)<\/code> table hint directly in the <code>FROM<\/code> clause of the query which you want to use the view like the following query:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * \n<span class=\"hljs-keyword\">FROM<\/span> production.product_master \n   <span class=\"hljs-keyword\">WITH<\/span> (NOEXPAND)\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> product_name;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this tutorial, you have learned how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"906\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/\"\n\t\t\t\tdata-post-title=\"SQL Server Indexed View\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"906\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/\"\n\t\t\t\tdata-post-title=\"SQL Server Indexed View\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":759,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-906","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server Indexed View: An Essential Guide with Practical Examples<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server Indexed View: An Essential Guide with Practical Examples\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-10T20:29:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/\",\"name\":\"SQL Server Indexed View: An Essential Guide with Practical Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/products-categories-brands.png\",\"datePublished\":\"2018-10-13T10:34:38+00:00\",\"dateModified\":\"2020-07-10T20:29:02+00:00\",\"description\":\"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/products-categories-brands.png\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/products-categories-brands.png\",\"width\":744,\"height\":169},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-indexed-view\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Views\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server Indexed View\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server Indexed View: An Essential Guide with Practical Examples","description":"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server Indexed View: An Essential Guide with Practical Examples","og_description":"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2020-07-10T20:29:02+00:00","og_image":[{"url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/","name":"SQL Server Indexed View: An Essential Guide with Practical Examples","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png","datePublished":"2018-10-13T10:34:38+00:00","dateModified":"2020-07-10T20:29:02+00:00","description":"This tutorial shows you how to create a SQL Server indexed view defined against tables that have infrequent data updates to improve the query performance.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-categories-brands.png","width":744,"height":169},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-indexed-view\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Views","item":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/"},{"@type":"ListItem","position":3,"name":"SQL Server Indexed View"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=906"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/906\/revisions"}],"predecessor-version":[{"id":2617,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/906\/revisions\/2617"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/759"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}