{"id":1933,"date":"2013-10-09T13:00:00","date_gmt":"2013-10-09T20:00:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/dataplatforminsider\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/"},"modified":"2024-01-22T22:49:09","modified_gmt":"2024-01-23T06:49:09","slug":"troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/","title":{"rendered":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes"},"content":{"rendered":"<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">In-Memory OLTP introduces a new type of index for memory-optimized tables in SQL Server 2014: the hash index. This new index type is optimized for index seek operations, i.e. finding the rows corresponding to a given set of equality predicates; for example, \u2018o_id=8 AND od_id=4\u2019. The underlying data structure of a hash index is a hash table, which is quite different from the B-tree data structure underlying the traditional (non)clustered indexes for disk-based tables. <\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;\"><span style=\"font-size:small;\">In this post we will not describe the hash index structures in details; more information can be found in the Books Online topic on <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dn133186(v=sql.120).aspx\"><span style=\"color:#0563c1;font-size:small;\">In-Memory OLTP<\/span><\/a><span style=\"font-size:small;\">. Instead, we focus on troubleshooting two common issues we have seen with customers using hash indexes. For each of the common issues we describe how to troubleshoot and how to work around the issue. Future blog posts will address further common performance problems. <\/span><\/span><\/p>\n<h1><span style=\"color:#2e74b5;\"><span style=\"font-family:Calibri Light;\">Hash index bucket count too low<\/span><\/span><\/h1>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>Issue<\/strong>: If the bucket count is significantly lower (think 10X) than the number of unique index keys, there will be many buckets that have multiple index keys. This degrades performance of most DML operations, in particular point lookups, i.e. lookups of individual index keys.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>Symptom<\/strong>: A performance degradation of queries that rely on lookups or inserts into the hash index. For example, SELECT queries and UPDATE\/DELETE operations with equality predicates matching the index key columns in the WHERE clause.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>How to troubleshoot<\/strong>: In some cases the problem is obvious from the index definition and the table data. For example, if the PRIMARY KEY has a HASH index with bucket_count 10,000, and the table has 1,000,000 rows, the bucket count is too low and will need to be changed.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;\"><span style=\"font-size:small;\">In addition to inspecting table schema and data, you can use the DMV <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dn296679(v=sql.120).aspx\"><span style=\"color:#0563c1;font-size:small;\">sys.dm_db_xtp_hash_index_stats<\/span><\/a><span style=\"font-size:small;\">. You can use the following query to obtain statistics concerning the buckets, and the row chains hanging off the buckets:<\/span><\/span><\/p>\n<p style=\"padding-left:30px;\"><code class=\"mysql\"><span style=\"color:#0000ff;\">SELECT<\/span> hs.<span style=\"color:#ff00ff;\">object_id<\/span>, <span style=\"color:#ff00ff;\">object_name<\/span>(hs.<span style=\"color:#ff00ff;\">object_id<\/span>) <span style=\"color:#0000ff;\">AS<\/span> <span style=\"color:#ff0000;\">'object name'<\/span>, i.name <span style=\"color:#0000ff;\">as<\/span> <span style=\"color:#ff0000;\">'index name'<\/span>, hs.*<br \/><span style=\"color:#0000ff;\">FROM<\/span> <span style=\"color:#339966;\">sys<\/span>.dm_db_xtp_hash_index_stats <span style=\"color:#0000ff;\">AS<\/span> hs <br \/>JOIN <span style=\"color:#339966;\">sys.indexes <\/span><span style=\"color:#0000ff;\">AS<\/span> i <span style=\"color:#0000ff;\">ON<\/span> hs.<span style=\"color:#ff00ff;\">object_id<\/span>=i.<span style=\"color:#ff00ff;\">object_id<\/span> AND hs.index_id=i.index_id;<\/code><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">A large average chain length indicates that many rows are hashed to the same bucket. If, in addition, the number of empty buckets is low or the average and maximum chain lengths are similar, it is likely that the total bucket count is too low. In this case, you need to increase the bucket_count. Typically, you would want the bucket_count to be between 1 and 2 times the number of unique index key values. Note that the bucket_count is automatically rounded up to the nearest power of 2.<\/span><\/p>\n<h1>\n<span style=\"font-family:Calibri;font-size:small;\">\u00a0<\/span><span style=\"color:#2e74b5;\"><span style=\"font-family:Calibri Light;\">Search requires a subset of hash index key columns<\/span><\/span><br \/>\n<\/h1>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>Issue<\/strong>: Hash indexes require values for all index key columns in order to compute the hash value, and locate the corresponding rows in the hash table. Therefore, if a query includes equality predicates for only a subset of the index keys in the WHERE clause, SQL Server cannot use an index seek to locate the rows corresponding to the predicates in the WHERE clause.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">In contrast, ordered indexes like the traditional disk-based (non)clustered indexes and the new memory-optimized nonclustered indexes (to be introduced in CTP2) support index seek on a subset of the index key columns, as long as they are the leading columns. <\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>Symptom<\/strong>: This results in a performance degradation, as SQL Server will need to execute full table scans, rather than an index seek, which is typically a far cheaper operation.\u00a0 <\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>How to troubleshoot<\/strong>: Besides the performance degradation, inspection of the query plans will also show a scan instead of an index seek. If the query is fairly simple, inspection of the query text and index definition will also show whether the search requires a subset of the index key columns.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">Consider the following table and query:<\/span><\/p>\n<pre class=\"scroll\"><code class=\"mysql\"><span style=\"color:#0000ff;\">create table<\/span> dbo.od<br> ( o_id <span style=\"color:#0000ff;\">int<\/span> not null,<br> od_id <span style=\"color:#0000ff;\">int<\/span> not null,<br> p_id <span style=\"color:#0000ff;\">int<\/span> not null,<br><br><span style=\"color:#0000ff;\">constraint<\/span> PK_od <span style=\"color:#0000ff;\">primary key<\/span> <br><span style=\"color:#0000ff;\">nonclustered hash<\/span> (o_id,od_id) <span style=\"color:#0000ff;\">with<\/span> (<span style=\"color:#0000ff;\">bucket_count<\/span>=10000)<br> ) <span style=\"color:#0000ff;\">with<\/span> (<span style=\"color:#0000ff;\">memory_optimized<\/span>=on)<br><br><span style=\"color:#0000ff;\">select<\/span> p_id<br><span style=\"color:#0000ff;\">from<\/span> dbo.od<br><span style=\"color:#0000ff;\">where<\/span> o_id=1<\/code><\/pre>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;\"><span style=\"font-size:small;\">\u00a0<\/span><span style=\"font-size:small;\">The table has a hash index on the two columns (o_id, od_id), while the query has an equality predicate on (o_id). As the query has equality predicates on only a subset of the index key columns, SQL Server cannot perform an index seek operation using PK_od; instead, SQL Server has to revert to a full index scan, as shown in the following query plan visualization:<\/span><\/span><\/p>\n<p style=\"text-align:center;\"><a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\" original-url=\"http:\/\/blogs.technet.com\/cfs-file.ashx\/__key\/communityserver-blogs-components-weblogfiles\/00-00-00-60-54\/6327.query-plan-visualization.png\"><img decoding=\"async\" style=\"border:0px currentColor;\" title=\"query plan visualization\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\" original-url=\"http:\/\/blogs.technet.com\/resized-image.ashx\/__size\/550x0\/__key\/communityserver-blogs-components-weblogfiles\/00-00-00-60-54\/6327.query-plan-visualization.png\" alt=\"query plan visualization\" srcset=\"\"><\/a><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\"><strong>Workarounds<\/strong>: There are a number of possible workarounds. For example:<\/span><\/p>\n<ul>\n<li><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">Re-create the index as type \u2018nonclustered\u2019 [available in CTP2] instead of \u2018nonclustered hash\u2019. The memory-optimized nonclustered index is ordered, and thus SQL Server can perform an index seek on the leading index key columns. The resulting primary key definition for the example would be:<\/span><\/li>\n<\/ul>\n<pre class=\"scroll\" style=\"padding-left:60px;\"><code class=\"cplusplus\"><span style=\"color:#0000ff;\">constraint<\/span> PK_od <span style=\"color:#0000ff;\">primary key nonclustered<\/span><\/code><\/pre>\n<ul>\n<li><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">Change the current index key to match the columns in the WHERE clause.<\/span><\/li>\n<li><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">Add a new hash index that matches with the columns in the WHERE clause of the query. In the example, the resulting table definition would look at follows:<\/span><\/li>\n<\/ul>\n<pre class=\"scroll\" style=\"padding-left:60px;\"><code class=\"cplusplus\"><span style=\"color:#0000ff;\">create table<\/span> dbo.od<br> ( o_id <span style=\"color:#0000ff;\">int<\/span> not null,<br> od_id <span style=\"color:#0000ff;\">int<\/span> not null,<br> p_id <span style=\"color:#0000ff;\">int<\/span> not null,<br><br><span style=\"color:#0000ff;\">constraint<\/span> PK_od <span style=\"color:#0000ff;\">primary key<\/span> <br><span style=\"color:#0000ff;\">nonclustered hash<\/span> (o_id,od_id) <span style=\"color:#0000ff;\">with<\/span> (<span style=\"color:#0000ff;\">bucket_count<\/span>=10000),<br><br><span style=\"background-color:#ffff00;\"> <span style=\"color:#0000ff;\">index<\/span> ix_o_id <span style=\"color:#0000ff;\">nonclustered hash<\/span> (o_id) <span style=\"color:#0000ff;\">with<\/span> (<span style=\"color:#0000ff;\">bucket_count<\/span>=10000)<\/span><br><br> ) <span style=\"color:#0000ff;\">with<\/span> (<span style=\"color:#0000ff;\">memory_optimized<\/span>=<span style=\"color:#0000ff;\">on<\/span>)<\/code><\/pre>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">Note that memory-optimized hash indexes do not perform optimally if there are a lot of duplicate rows for a given index key value: in the example, if the number of unique values for the column o_id is much smaller than the number of rows in the table, it would not be optimal to add an index on (o_id); instead, changing the type of the index PK_od from hash to nonclustered would be the better solution.<\/span><\/p>\n<p><span style=\"font-family:tahoma,arial,helvetica,sans-serif;font-size:small;\">For more information, <a href=\"http:\/\/technet.microsoft.com\/en-US\/evalcenter\/dn205290?WT.mc_id=Blog_SQL_InMem_SQL2014\">download SQL Server CTP1<\/a>\u00a0and get started today, or see more blogs in the <a href=\"\/sqlserver\/2013\/06\/26\/sql-server-2014-in-memory-technologies-blog-series-introduction\/\">series introduction and index here<\/a>.<\/span><\/p>\n<p>\u00a0<\/p>\n<h1><span style=\"color:#2e74b5;font-family:Calibri Light;\">\u00a0<\/span><\/h1>\n","protected":false},"excerpt":{"rendered":"<p>In-Memory OLTP introduces a new type of index for memory-optimized tables in SQL Server 2014: the hash index. This new index type is optimized for index seek operations, i.e. finding the rows corresponding to a given set of equality predicates; for example, \u2018o_id=8 AND od_id=4\u2019.<\/p>\n","protected":false},"author":1457,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[],"product":[],"content-type":[2424],"topic":[],"coauthors":[2487],"class_list":["post-1933","post","type-post","status-publish","format-standard","hentry","content-type-best-practices","review-flag-1593580427-503","review-flag-1-1593580431-15","review-flag-2-1593580436-981","review-flag-4-1593580446-456","review-flag-8-1593580467-480","review-flag-new-1593580247-437"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog<\/title>\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.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog\" \/>\n<meta property=\"og:description\" content=\"In-Memory OLTP introduces a new type of index for memory-optimized tables in SQL Server 2014: the hash index. This new index type is optimized for index seek operations, i.e. finding the rows corresponding to a given set of equality predicates; for example, \u2018o_id=8 AND od_id=4\u2019.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft SQL Server Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/sqlserver\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-09T20:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-23T06:49:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\" \/>\n<meta name=\"author\" content=\"SQL Server Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:site\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"SQL Server Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/sql-server-team\/\",\"@type\":\"Person\",\"@name\":\"SQL Server Team\"}],\"headline\":\"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes\",\"datePublished\":\"2013-10-09T20:00:00+00:00\",\"dateModified\":\"2024-01-23T06:49:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\"},\"wordCount\":880,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\",\"name\":\"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\",\"datePublished\":\"2013-10-09T20:00:00+00:00\",\"dateModified\":\"2024-01-23T06:49:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"name\":\"Microsoft SQL Server Blog\",\"description\":\"Official News from Microsoft\u2019s Information Platform\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\",\"name\":\"Microsoft SQL Server Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"width\":259,\"height\":194,\"caption\":\"Microsoft SQL Server Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/www.facebook.com\/sqlserver\",\"https:\/\/x.com\/SQLServer\",\"https:\/\/www.youtube.com\/user\/MSCloudOS\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog","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.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog","og_description":"In-Memory OLTP introduces a new type of index for memory-optimized tables in SQL Server 2014: the hash index. This new index type is optimized for index seek operations, i.e. finding the rows corresponding to a given set of equality predicates; for example, \u2018o_id=8 AND od_id=4\u2019.","og_url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/","og_site_name":"Microsoft SQL Server Blog","article_publisher":"http:\/\/www.facebook.com\/sqlserver","article_published_time":"2013-10-09T20:00:00+00:00","article_modified_time":"2024-01-23T06:49:09+00:00","og_image":[{"url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png","type":"","width":"","height":""}],"author":"SQL Server Team","twitter_card":"summary_large_image","twitter_creator":"@SQLServer","twitter_site":"@SQLServer","twitter_misc":{"Written by":"SQL Server Team","Est. reading time":"4 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/sql-server-team\/","@type":"Person","@name":"SQL Server Team"}],"headline":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes","datePublished":"2013-10-09T20:00:00+00:00","dateModified":"2024-01-23T06:49:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/"},"wordCount":880,"commentCount":8,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/","name":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes - Microsoft SQL Server Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png","datePublished":"2013-10-09T20:00:00+00:00","dateModified":"2024-01-23T06:49:09+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#primaryimage","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/03\/6327.query20plan20visualization.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/09\/troubleshooting-common-performance-problems-with-memory-optimized-hash-indexes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting Common Performance Problems with Memory-Optimized Hash Indexes"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","name":"Microsoft SQL Server Blog","description":"Official News from Microsoft\u2019s Information Platform","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization","name":"Microsoft SQL Server Blog","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","width":259,"height":194,"caption":"Microsoft SQL Server Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/sqlserver","https:\/\/x.com\/SQLServer","https:\/\/www.youtube.com\/user\/MSCloudOS"]}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/1933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/users\/1457"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/comments?post=1933"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/1933\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/media?parent=1933"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/post_tag?post=1933"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/product?post=1933"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/content-type?post=1933"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/topic?post=1933"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/coauthors?post=1933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}