{"id":229,"date":"2023-12-29T08:55:00","date_gmt":"2023-12-29T13:55:00","guid":{"rendered":"https:\/\/www.sqltabletalk.com\/?p=229"},"modified":"2023-12-29T10:21:46","modified_gmt":"2023-12-29T15:21:46","slug":"in-memory-oltp-in-sql-server-leveraging-in-memory-tables-for-performance","status":"publish","type":"post","link":"https:\/\/www.sqltabletalk.com\/?p=229","title":{"rendered":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance"},"content":{"rendered":"\n<p><strong>Introduction<\/strong><\/p>\n\n\n\n<p>In the relentless pursuit of performance, database administrators and developers continually seek strategies to make applications faster and more efficient. SQL Server&#8217;s In-Memory Online Transaction Processing (In-Memory OLTP) feature is a significant stride in this quest. This blog post will dive into the world of In-Memory OLTP, exploring what it is, its benefits, how to get started, best practices, and conclude with some final thoughts.<\/p>\n\n\n\n<p><strong>Understanding In-Memory OLTP Tables<\/strong><\/p>\n\n\n\n<p>In-Memory OLTP, introduced in SQL Server 2014, revolutionizes the way SQL Server manages data transactions. Traditionally, SQL Server stored and managed data on disk, which, despite optimizations like caching, still involved disk I\/O operations that could be a performance bottleneck. In-Memory OLTP changes this paradigm by keeping designated tables entirely in memory.<\/p>\n\n\n\n<p>These tables, known as memory-optimized tables, are fully transactional and integrated with SQL Server&#8217;s relational capabilities but designed to reside in the server&#8217;s memory. This approach dramatically reduces the I\/O latency that comes with disk-based tables, as memory access is orders of magnitude faster than disk.<\/p>\n\n\n\n<p><strong>Benefits of In-Memory Tables<\/strong><\/p>\n\n\n\n<p>The performance gains of using In-Memory OLTP can be substantial, especially for workloads characterized by high concurrency and transaction rates. Here are some of the key benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Reduced Latency<\/strong>: With data residing in memory, transaction times are significantly reduced, making operations faster and more responsive.<\/li>\n\n\n\n<li><strong>High Throughput<\/strong>: Memory-optimized tables can handle millions of transactions per second, benefiting high-load and mission-critical applications.<\/li>\n\n\n\n<li><strong>Concurrency Enhancements<\/strong>: In-Memory OLTP uses an optimistic concurrency control mechanism, reducing contention and locking issues common in traditional disk-based tables.<\/li>\n\n\n\n<li><strong>Flexibility<\/strong>: It&#8217;s not all or nothing; you can selectively apply In-Memory OLTP to the tables and stored procedures that would benefit most from it.<\/li>\n<\/ul>\n\n\n\n<p>Getting Your Database Ready for In-Memory OLTP<\/p>\n\n\n\n<p>Setting up a filegroup specifically for In-Memory OLTP in SQL Server is a necessary step before you can start creating and using memory-optimized tables. Here\u2019s a brief guide on how to set up this special filegroup:<\/p>\n\n\n\n<p><strong>Setting Up a Memory-Optimized Filegroup for In-Memory OLTP<\/strong><\/p>\n\n\n\n<p>1. <strong>Understand the Requirement<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In-Memory OLTP requires a special filegroup designated as MEMORY_OPTIMIZED_DATA to store the memory-optimized tables. This filegroup is different from the regular ones used for disk-based tables and is necessary to utilize In-Memory OLTP features.<\/li>\n<\/ul>\n\n\n\n<p>2. <strong>Add a Memory-Optimized Filegroup<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need to add a new filegroup to your database specifically for memory-optimized data. Use the following T-SQL command, making sure to replace <strong>YourDatabaseName<\/strong> and <strong>YourMemoryOptimizedFilegroupName<\/strong> with appropriate names for your database and filegroup:<\/li>\n<\/ul>\n\n\n\n<p><code>\nALTER DATABASE YourDatabaseName <br>\nADD FILE <br>\n(<br>\n    NAME = 'YourMemoryOptimizedFileName',<br>\n    FILENAME = 'C:\\Path\\To\\YourMemoryOptimizedFile' -- Specify a valid path for your environment<br>\n) <br>\nTO FILEGROUP YourMemoryOptimizedFilegroupName;<br>\n<\/code><\/p>\n\n\n<p>3. <strong>Add a Container (File) to the Memory-Optimized Filegroup<\/strong>:<\/p>\n<p><!-- \/wp:post-content --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li>Once the filegroup is created, you need to add at least one file to it. This file acts as a container for the memory-optimized data. Execute the following T-SQL command, replacing placeholders with actual values for your environment:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><code>-- Add a container to the memory-optimized filegroup<br \/>\nALTER DATABASE YourDatabaseName<br \/>\nADD FILE<br \/>\n(<br \/>\n    NAME = 'YourMemoryOptimizedFileName',<br \/>\n    FILENAME = 'C:\\Path\\To\\YourMemoryOptimizedFile' -- Specify a valid path for your environment<br \/>\n)<br \/>\nTO FILEGROUP YourMemoryOptimizedFilegroupName;<br \/>\n<\/code><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li><strong>NAME<\/strong> is the logical name for your file inside SQL Server.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>FILENAME<\/strong> is the path to the file on the server&#8217;s file system. Ensure that the SQL Server service account has the necessary permissions to access this path, and it&#8217;s recommended to use a reliable and fast storage medium.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>4. <strong>Considerations for the File Path<\/strong>:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li>The path specified for <strong>FILENAME<\/strong> must be unique to this memory-optimized filegroup and not used by other files or databases.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>The directory should be dedicated to SQL Server and the memory-optimized filegroup to prevent contention and ensure security.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Getting Started with In-Memory OLTP<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>To begin using In-Memory OLTP, you&#8217;ll need to follow these general steps:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list {\"ordered\":true,\"start\":1} --><\/p>\n<ol start=\"1\">\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li><strong>Evaluate Compatibility and Requirements<\/strong>: Ensure your system meets the requirements for In-Memory OLTP and assess which parts of your application could benefit from it.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Define Memory-Optimized Tables<\/strong>: Convert or create new tables as memory-optimized tables. You can do this through SQL Server Management Studio or T-SQL commands.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Migrate Data<\/strong>: If you&#8217;re converting existing tables, migrate the data into the new memory-optimized format.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Update Applications<\/strong>: Ensure your application logic is compatible with memory-optimized tables and make any necessary changes.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>Let&#8217;s delve into some specific examples of how to use In-Memory OLTP in SQL Server by creating and utilizing memory-optimized tables and natively compiled stored procedures. Each example will include an explanation to ensure you understand how it works and can implement something similar in your environment.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Example 1: Creating a Memory-Optimized Table<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Scenario<\/strong>: You have a heavily accessed table named &#8216;CustomerOrders&#8217; that&#8217;s central to your transaction processing system. It&#8217;s frequently updated and accessed, leading to performance bottlenecks.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Action<\/strong>: Create a memory-optimized version of this table.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>SQL Script<\/strong>:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><code>CREATE TABLE dbo.Orders<br \/>\n(<br \/>\n    OrderID int NOT NULL PRIMARY KEY NONCLUSTERED,<br \/>\n    OrderDate datetime2 NOT NULL,<br \/>\n    ProductID int NOT NULL,<br \/>\n    Quantity int NOT NULL,<br \/>\n    -- Defines the table as memory-optimized<br \/>\n    INDEX ix_OrderDate NONCLUSTERED HASH (OrderDate) WITH (BUCKET_COUNT = 1024)<br \/>\n) WITH (MEMORY_OPTIMIZED = ON);<br \/>\n<\/code><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Explanation<\/strong>:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li><strong>MEMORY_OPTIMIZED = ON<\/strong>: This clause is critical as it indicates that the table should be memory-optimized.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>PRIMARY KEY NONCLUSTERED<\/strong>: Memory-optimized tables require a primary key, and here it&#8217;s specified as nonclustered because memory-optimized tables don&#8217;t support clustered indexes.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>INDEX IX_OrderDate<\/strong>: This is a nonclustered hash index on the <strong>OrderDate<\/strong> column, which is typical for columns frequently used in equality searches. The <strong>BUCKET_COUNT<\/strong> is an attribute specific to hash indexes and should be chosen based on the expected number of unique values.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Example 2: Migrating Data to Memory-Optimized Table<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Scenario<\/strong>: After creating the memory-optimized &#8216;CustomerOrders&#8217;, you need to migrate data from the existing disk-based table.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Action<\/strong>: Migrate data from the old &#8216;CustomerOrders&#8217; table to the new memory-optimized version.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>SQL Script<\/strong>:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>&#8212; Assuming the old table is named CustomerOrders_old<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><code>INSERT INTO dbo.Orders_memoryOptimized (OrderID, OrderDate, ProductID, Quantity)<br \/>\nSELECT OrderID, OrderDate, ProductID, Quantity FROM dbo.Orders;<br \/>\n<\/code><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Explanation<\/strong>:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li>This script selects all data from the existing &#8216;CustomerOrders_old&#8217; table and inserts it into the new &#8216;CustomerOrders&#8217; memory-optimized table.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>It&#8217;s a straightforward one-time migration to populate the new table with existing data.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Example 3: Using Natively Compiled Stored Procedures<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Scenario<\/strong>: You want to optimize a stored procedure that frequently inserts data into &#8216;CustomerOrders&#8217;, leveraging the speed of In-Memory OLTP.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Action<\/strong>: Create a natively compiled stored procedure for inserting orders.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>SQL Script<\/strong>:<\/p>\n<p><code>CREATE PROCEDURE InsertOrder<br \/>\n    @OrderID int,<br \/>\n    @CustomerID int,<br \/>\n    @OrderDate datetime2,<br \/>\n    @TotalAmount decimal(19,4)<br \/>\nWITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER<br \/>\nAS<br \/>\nBEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'English')<br \/>\n    INSERT INTO CustomerOrders (OrderID, CustomerID, OrderDate, TotalAmount)<br \/>\n    VALUES (@OrderID, @CustomerID, @OrderDate, @TotalAmount);<br \/>\nEND;<br \/>\n<\/code><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li><strong>NATIVE_COMPILATION<\/strong>: Indicates that the stored procedure is natively compiled, meaning it&#8217;s compiled into machine code for faster execution.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>SCHEMABINDING<\/strong>: Ensures that the objects referenced in the procedure can&#8217;t be modified unless the procedure is also modified.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>BEGIN ATOMIC<\/strong>: Required for natively compiled stored procedures, defining the transaction behavior and language setting.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>The procedure itself is a simple insert operation, benefiting from the performance improvements of being natively compiled and interacting with a memory-optimized table.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Best Practices<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>While In-Memory OLTP can offer significant performance improvements, it&#8217;s essential to follow best practices to ensure a successful implementation:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul><!-- wp:list-item -->\n<li><strong>Start Small and Monitor<\/strong>: Begin by implementing In-Memory OLTP on a small scale and monitor the performance impacts before expanding its use.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Memory Management<\/strong>: Monitor your server&#8217;s memory usage closely. Remember, memory-optimized tables reside entirely in memory, so adequate memory allocation is crucial.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Choose the Right Workloads<\/strong>: Not all workloads will benefit equally from In-Memory OLTP. Target high-throughput, latency-sensitive workloads for the best results.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- wp:list-item --><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Keep Updated<\/strong>: Stay informed about the latest improvements and recommendations from Microsoft, as each new version of SQL Server may bring enhancements to In-Memory OLTP.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:list-item --><\/p>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>In-Memory OLTP represents a powerful tool in the SQL Server performance tuning arsenal, offering unprecedented speed improvements for the right workloads. By understanding what it is, the benefits it provides, and how to implement it effectively, you can unlock new levels of performance in your SQL Server environments. As with any technology, a thoughtful, measured approach, guided by best practices, will help you make the most of In-Memory OLTP&#8217;s capabilities. Embrace the speed of in-memory, and propel your applications into a faster, more efficient future!<\/p>\n<p><!-- \/wp:paragraph --><\/p><!-- \/wp:paragraph -->","protected":false},"excerpt":{"rendered":"<p>In the relentless pursuit of performance, database administrators and developers continually seek strategies to make applications faster and more efficient. SQL Server&#8217;s In-Memory Online Transaction Processing (In-Memory OLTP) feature is a significant stride in this quest. This blog post will dive into the world of In-Memory OLTP, exploring what it is, its benefits, how to get started, best practices, and conclude with some final thoughts.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,6,5],"tags":[69,68,52],"class_list":["post-229","post","type-post","status-publish","format-standard","hentry","category-internals","category-memory","category-performance","tag-in-memory-tables","tag-oltp","tag-sql-server-performance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk<\/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.sqltabletalk.com\/?p=229\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk\" \/>\n<meta property=\"og:description\" content=\"In the relentless pursuit of performance, database administrators and developers continually seek strategies to make applications faster and more efficient. SQL Server&#039;s In-Memory Online Transaction Processing (In-Memory OLTP) feature is a significant stride in this quest. This blog post will dive into the world of In-Memory OLTP, exploring what it is, its benefits, how to get started, best practices, and conclude with some final thoughts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltabletalk.com\/?p=229\" \/>\n<meta property=\"og:site_name\" content=\"SQL Table Talk\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-29T13:55:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-29T15:21:46+00:00\" \/>\n<meta name=\"author\" content=\"Stephen Planck\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stephen Planck\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229\"},\"author\":{\"name\":\"Stephen Planck\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"headline\":\"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance\",\"datePublished\":\"2023-12-29T13:55:00+00:00\",\"dateModified\":\"2023-12-29T15:21:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229\"},\"wordCount\":1210,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"keywords\":[\"in memory tables\",\"OLTP\",\"SQL Server performance\"],\"articleSection\":[\"Internals\",\"Memory\",\"Performance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=229#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229\",\"url\":\"https:\/\/www.sqltabletalk.com\/?p=229\",\"name\":\"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\"},\"datePublished\":\"2023-12-29T13:55:00+00:00\",\"dateModified\":\"2023-12-29T15:21:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=229\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=229#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltabletalk.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\",\"url\":\"https:\/\/www.sqltabletalk.com\/\",\"name\":\"SQL Table Talk\",\"description\":\"Breaking Down SQL Server, One Post at a Time.\",\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltabletalk.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\",\"name\":\"Stephen Planck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"caption\":\"Stephen Planck\"},\"logo\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/dexterwiki.com\",\"https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI\",\"https:\/\/www.youtube.com\/linuxmate\"],\"url\":\"https:\/\/www.sqltabletalk.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk","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.sqltabletalk.com\/?p=229","og_locale":"en_US","og_type":"article","og_title":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk","og_description":"In the relentless pursuit of performance, database administrators and developers continually seek strategies to make applications faster and more efficient. SQL Server's In-Memory Online Transaction Processing (In-Memory OLTP) feature is a significant stride in this quest. This blog post will dive into the world of In-Memory OLTP, exploring what it is, its benefits, how to get started, best practices, and conclude with some final thoughts.","og_url":"https:\/\/www.sqltabletalk.com\/?p=229","og_site_name":"SQL Table Talk","article_published_time":"2023-12-29T13:55:00+00:00","article_modified_time":"2023-12-29T15:21:46+00:00","author":"Stephen Planck","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stephen Planck","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqltabletalk.com\/?p=229#article","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/?p=229"},"author":{"name":"Stephen Planck","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"headline":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance","datePublished":"2023-12-29T13:55:00+00:00","dateModified":"2023-12-29T15:21:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqltabletalk.com\/?p=229"},"wordCount":1210,"commentCount":0,"publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"keywords":["in memory tables","OLTP","SQL Server performance"],"articleSection":["Internals","Memory","Performance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqltabletalk.com\/?p=229#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqltabletalk.com\/?p=229","url":"https:\/\/www.sqltabletalk.com\/?p=229","name":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance - SQL Table Talk","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/#website"},"datePublished":"2023-12-29T13:55:00+00:00","dateModified":"2023-12-29T15:21:46+00:00","breadcrumb":{"@id":"https:\/\/www.sqltabletalk.com\/?p=229#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltabletalk.com\/?p=229"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltabletalk.com\/?p=229#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltabletalk.com\/"},{"@type":"ListItem","position":2,"name":"In-Memory OLTP in SQL Server: Leveraging In-Memory Tables for Performance"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltabletalk.com\/#website","url":"https:\/\/www.sqltabletalk.com\/","name":"SQL Table Talk","description":"Breaking Down SQL Server, One Post at a Time.","publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltabletalk.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0","name":"Stephen Planck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","caption":"Stephen Planck"},"logo":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/dexterwiki.com","https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI","https:\/\/www.youtube.com\/linuxmate"],"url":"https:\/\/www.sqltabletalk.com\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229"}],"version-history":[{"count":5,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":315,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions\/315"}],"wp:attachment":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}