{"id":28445,"date":"2016-12-02T09:51:38","date_gmt":"2016-12-02T16:51:38","guid":{"rendered":"https:\/\/virtual-dba.com\/?p=28445"},"modified":"2023-03-24T08:07:56","modified_gmt":"2023-03-24T15:07:56","slug":"improving-foreign-key-performance-indexing","status":"publish","type":"post","link":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/","title":{"rendered":"Improving Foreign Key Performance with Indexing"},"content":{"rendered":"<p>A Foreign Key is a constraint. Due to this definition, it only places a limitation on what data can be inserted into a column(s) and does not address the indexes needed to help performance when joining tables<\/p>\n<p>Take the following design.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28446\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-1.jpg\" alt=\"foreignkeysandindexes-1\" width=\"624\" height=\"297\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-1.jpg 624w, https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-1-300x143.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>If you wanted to join the 2 table to return the person\u2019s name and address you would write the following query:<\/p>\n<p>[php] Select Concat(p.FirstName ,&#8217; &#8216; ,p.LastName) ,a.StreetName ,a.City from person p inner join address a on (p.PersonID = a.PersonID) where p.personID in (100,1000,2000) [\/php]<\/p>\n<p>The current design takes into account the primary cluster indexes on the person. personID column, but does not have an index defined on the Address.personID column.<\/p>\n<p>The foreign keys are normally used in the From clause for your joins on how to link the data between the 2 tables. It is highly recommended to create indexes on both tables for these columns. Most of the time (but not always), the parent table will already have an index defined on the column used in the foreign key definition. In the example above, most likely there is a cluster primary key defined on the personID column in the person table. But unless it was specified, there would not be a non-clustered index on the personID in the address table.<\/p>\n<p>When executing the query above, SQL Server generates the following execution plan. As you can see, SQL Server is hinting an index would help improve query performance. With the limitations of just a couple of personID from the person table, SQL Server is using an index Seek to find the data needed. It is using the clustered index on the address table but you can see it is still having to run a scan of the index. This means if your table has 3 million row, it would have to scan all 3 million to pull back just the records that match the limitation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28447\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-2.jpg\" alt=\"foreignkeysandindexes-2\" width=\"624\" height=\"144\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-2.jpg 624w, https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-2-300x69.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>Now if you add your nonclustered index on the Foreign Key column in the address table and re-execute the statement, SQL Server is now using Index Seeks for both tables.<\/p>\n<p>[php]create index FKIndexpersonID on dbo.address(personID)[\/php] <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28449\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-3.jpg\" alt=\"foreignkeysandindexes-3\" width=\"624\" height=\"176\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-3.jpg 624w, https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-3-300x85.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>In reviewing the above query plan, I can see there is one more step I could take to help performance. The key lookup on the clustered PK index is due to query wanting data which is not a part of the index used in the join (streetName, city)<\/p>\n<p>The original execution plan was hinting SQL Server would benefit from a covering index to improve the performance. If I drop and recreate the index with the two include columns, the execution plan is now showing SQL server only needed to use 2 index seeks to pull the data needed for the results of the query.<\/p>\n<p>[php] drop index FKIndexpersonID on dbo.address(personID) [\/php] <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28450\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-4.jpg\" alt=\"foreignkeysandindexes-4\" width=\"624\" height=\"142\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-4.jpg 624w, https:\/\/virtual-dba.com\/wp-content\/uploads\/ForeignKeysandIndexes-4-300x68.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>Defining a foreign key constraint does not create the underlying index. A constraint only put a limit on what data can be inserted into the column.<\/p>\n<p>Adding a non-clustered index to the Foreign Key Column in the child table can increase query performance by removing Table or Index Scans with Index Seeks. Adding include columns to make the index a covering index can improve performance even further by removing the Key Look to retrieve the extra columns from the child table.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Foreign Key is a constraint. Due to this definition, it only places a limitation on what data can be inserted into a column(s) and does not address the indexes needed to help performance when joining tables Take the following design. If you wanted to join the 2 table to return the person\u2019s name and [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":30197,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"[caption id=\"attachment_29265\" align=\"alignnone\" width=\"1000\"]<img src=\"https:\/\/virtual-dba.com\/media\/foreign-key-indexing.jpg\" alt=\"Foreign Key Indexing\" width=\"1000\" height=\"667\" class=\"size-full wp-image-29265\" \/> Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.[\/caption]\r\n\r\n<p>A Foreign Key is a constraint. Due to this definition, it only places a limitation on what data can be inserted into a column(s) and does not address the indexes needed to help performance when joining tables<\/p>\r\n<p>Take the following design.<\/p>\r\n<img src=\"https:\/\/virtual-dba.com\/media\/ForeignKeysandIndexes-1.jpg\" alt=\"foreignkeysandindexes-1\" width=\"624\" height=\"297\" class=\"alignnone size-full wp-image-28446\" \/>\r\n<p>If you wanted to join the 2 table to return the person\u2019s name and address you would write the following query:<\/p>\r\n[php]\r\nSelect Concat(p.FirstName ,' ' ,p.LastName)\r\n,a.StreetName\r\n,a.City\r\n \r\n \r\nfrom person p\r\ninner join address a\r\non (p.PersonID = a.PersonID)\r\n \r\nwhere p.personID in (100,1000,2000)\r\n[\/php]\r\n\r\n<p>The current design takes into account the primary cluster indexes on the person.personID column, but does not have an index defined on the Address.personID column.<\/p>\r\n \r\n<p>The foreign keys are normally used in the From clause for your joins on how to link the data between the 2 tables. It is highly recommended to create indexes on both tables for these columns.  Most of the time (but not always), the parent table will already have an index defined on the column used in the foreign key definition. In the example above, most likely there is a cluster primary key defined on the personID column in the person table. But unless it was specified, there would not be a non-clustered index on the personID in the address table.<\/p>\r\n \r\n<p>When executing the query above, SQL Server generates the following execution plan. As you can see, SQL Server is hinting an index would help improve query performance. With the limitations of just a couple of personID from the person table, SQL Server is using an index Seek to find the data needed. It is using the clustered index on the address table but you can see it is still having to run a scan of the index. This means if your table has 3 million row, it would have to scan all 3 million to pull back just the records that match the limitation.<\/p>\r\n\r\n<img src=\"https:\/\/virtual-dba.com\/media\/ForeignKeysandIndexes-2.jpg\" alt=\"foreignkeysandindexes-2\" width=\"624\" height=\"144\" class=\"alignnone size-full wp-image-28447\" \/>\r\n\r\n<p>Now if you add your nonclustered index on the Foreign Key column in the address table and re-execute the statement, SQL Server is now using Index Seeks for both tables.<\/p>\r\n[php]create index FKIndexpersonID on dbo.address(personID)[\/php]\r\n\r\n<img src=\"https:\/\/virtual-dba.com\/media\/ForeignKeysandIndexes-3.jpg\" alt=\"foreignkeysandindexes-3\" width=\"624\" height=\"176\" class=\"alignnone size-full wp-image-28449\" \/>\r\n\r\n<p>In reviewing the above query plan, I can see there is one more step I could take to help performance. The key lookup on the clustered PK index is due to query wanting data which is not a part of the index used in the join (streetName, city)<\/p>\r\n<p>The original execution plan was hinting SQL Server would benefit from a covering index to improve the performance. If I drop and recreate the index with the two include columns, the execution plan is now showing SQL server only needed to use 2 index seeks to pull the data needed for the results of the query.<\/p>\r\n\r\n[php]\r\ndrop index FKIndexpersonID on dbo.address(personID)\r\n \r\n[\/php]\r\n\r\n<img src=\"https:\/\/virtual-dba.com\/media\/ForeignKeysandIndexes-4.jpg\" alt=\"foreignkeysandindexes-4\" width=\"624\" height=\"142\" class=\"alignnone size-full wp-image-28450\" \/>\r\n\r\n<p>Defining a foreign key constraint does not create the underlying index. A constraint only put a limit on what data can be inserted into the column.<\/p>\r\n<p>Adding a non-clustered index to the Foreign Key Column in the child table can increase query performance by removing Table or Index Scans with Index Seeks. Adding include columns to make the index a covering index can improve performance even further by removing the Key Look to retrieve the extra columns from the child table.<\/p>","_et_gb_content_width":"","content-type":"","footnotes":""},"categories":[4166,55],"tags":[764,60],"class_list":["post-28445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-sql-server","tag-foreign-key","tag-sql-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.1 (Yoast SEO v27.1.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Improving Microsoft SQL Server Foreign Key Performance with Indexing<\/title>\n<meta name=\"description\" content=\"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improving Foreign Key Performance with Indexing\" \/>\n<meta property=\"og:description\" content=\"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-02T16:51:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-24T15:07:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"557\" \/>\n\t<meta property=\"og:image:height\" content=\"291\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kathleen Long\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:site\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kathleen Long\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\"},\"author\":{\"name\":\"Kathleen Long\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/91b6f7be0a06fc49cf1d5328a87307e4\"},\"headline\":\"Improving Foreign Key Performance with Indexing\",\"datePublished\":\"2016-12-02T16:51:38+00:00\",\"dateModified\":\"2023-03-24T15:07:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\"},\"wordCount\":558,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg\",\"keywords\":[\"foreign key\",\"sql server\"],\"articleSection\":[\"Blog\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\",\"url\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\",\"name\":\"Improving Microsoft SQL Server Foreign Key Performance with Indexing\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg\",\"datePublished\":\"2016-12-02T16:51:38+00:00\",\"dateModified\":\"2023-03-24T15:07:56+00:00\",\"description\":\"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg\",\"width\":557,\"height\":291,\"caption\":\"improving-foreign-key-performance-indexing\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtual-dba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improving Foreign Key Performance with Indexing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtual-dba.com\/#website\",\"url\":\"https:\/\/virtual-dba.com\/\",\"name\":\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\",\"description\":\"Remote Database Administration\",\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtual-dba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/virtual-dba.com\/#organization\",\"name\":\"Virtual-DBA: Remote DBA | Remote Database Administration\",\"alternateName\":\"Virtual-DBA powered by XTIVIA\",\"url\":\"https:\/\/virtual-dba.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"width\":557,\"height\":291,\"caption\":\"Virtual-DBA: Remote DBA | Remote Database Administration\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/virtual_dba\",\"https:\/\/www.linkedin.com\/showcase\/36220649\/\",\"https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg\"],\"description\":\"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.\",\"email\":\"info@xtivia.com\",\"telephone\":\"8886853101\",\"legalName\":\"XTIVIA, Inc\",\"foundingDate\":\"1992-05-01\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"201\",\"maxValue\":\"500\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/91b6f7be0a06fc49cf1d5328a87307e4\",\"name\":\"Kathleen Long\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af8477b0e038ae09f59ba1970defbe9c9d9c4b7605aec9d3a6fd4f0d659280a3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af8477b0e038ae09f59ba1970defbe9c9d9c4b7605aec9d3a6fd4f0d659280a3?s=96&d=mm&r=g\",\"caption\":\"Kathleen Long\"},\"url\":\"https:\/\/virtual-dba.com\/author\/kathleen-long\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Improving Microsoft SQL Server Foreign Key Performance with Indexing","description":"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.","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:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/","og_locale":"en_US","og_type":"article","og_title":"Improving Foreign Key Performance with Indexing","og_description":"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.","og_url":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/","og_site_name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","article_published_time":"2016-12-02T16:51:38+00:00","article_modified_time":"2023-03-24T15:07:56+00:00","og_image":[{"width":557,"height":291,"url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg","type":"image\/jpeg"}],"author":"Kathleen Long","twitter_card":"summary_large_image","twitter_creator":"@virtual_dba","twitter_site":"@virtual_dba","twitter_misc":{"Written by":"Kathleen Long","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#article","isPartOf":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/"},"author":{"name":"Kathleen Long","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/91b6f7be0a06fc49cf1d5328a87307e4"},"headline":"Improving Foreign Key Performance with Indexing","datePublished":"2016-12-02T16:51:38+00:00","dateModified":"2023-03-24T15:07:56+00:00","mainEntityOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/"},"wordCount":558,"commentCount":0,"publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg","keywords":["foreign key","sql server"],"articleSection":["Blog","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/","url":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/","name":"Improving Microsoft SQL Server Foreign Key Performance with Indexing","isPartOf":{"@id":"https:\/\/virtual-dba.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg","datePublished":"2016-12-02T16:51:38+00:00","dateModified":"2023-03-24T15:07:56+00:00","description":"Learn how to improving foreign key performance with indexing in Microsoft SQL Server from top SQL Server database expert and Microsoft Partner Virtual-DBA.","breadcrumb":{"@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#primaryimage","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/foreign-key-indexing-1.jpg","width":557,"height":291,"caption":"improving-foreign-key-performance-indexing"},{"@type":"BreadcrumbList","@id":"https:\/\/virtual-dba.com\/blog\/improving-foreign-key-performance-indexing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtual-dba.com\/"},{"@type":"ListItem","position":2,"name":"Improving Foreign Key Performance with Indexing"}]},{"@type":"WebSite","@id":"https:\/\/virtual-dba.com\/#website","url":"https:\/\/virtual-dba.com\/","name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","description":"Remote Database Administration","publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtual-dba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/virtual-dba.com\/#organization","name":"Virtual-DBA: Remote DBA | Remote Database Administration","alternateName":"Virtual-DBA powered by XTIVIA","url":"https:\/\/virtual-dba.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","width":557,"height":291,"caption":"Virtual-DBA: Remote DBA | Remote Database Administration"},"image":{"@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/virtual_dba","https:\/\/www.linkedin.com\/showcase\/36220649\/","https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg"],"description":"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.","email":"info@xtivia.com","telephone":"8886853101","legalName":"XTIVIA, Inc","foundingDate":"1992-05-01","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"201","maxValue":"500"}},{"@type":"Person","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/91b6f7be0a06fc49cf1d5328a87307e4","name":"Kathleen Long","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/af8477b0e038ae09f59ba1970defbe9c9d9c4b7605aec9d3a6fd4f0d659280a3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af8477b0e038ae09f59ba1970defbe9c9d9c4b7605aec9d3a6fd4f0d659280a3?s=96&d=mm&r=g","caption":"Kathleen Long"},"url":"https:\/\/virtual-dba.com\/author\/kathleen-long\/"}]}},"_links":{"self":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/28445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/comments?post=28445"}],"version-history":[{"count":0,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/28445\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media\/30197"}],"wp:attachment":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media?parent=28445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/categories?post=28445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/tags?post=28445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}