Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 1.25 KB

memory-optimized-tables.md

File metadata and controls

16 lines (12 loc) · 1.25 KB
title description author ms.date uid
Microsoft SQL Server Database Provider - Memory-Optimized Tables - EF Core
How to use Memory-Optimized Tables with the SQL Server Entity Framework Core Database Provider
AndriySvyryd
11/05/2019
core/providers/sql-server/memory-optimized-tables

Memory-Optimized Tables support in SQL Server EF Core Database Provider

Memory-Optimized Tables are a feature of SQL Server where the entire table resides in memory. A second copy of the table data is maintained on disk, but only for durability purposes. Data in memory-optimized tables is only read from disk during database recovery. For example, after a server restart.

Configuring a memory-optimized table

You can specify that the table an entity is mapped to is memory-optimized. When using EF Core to create and maintain a database based on your model (either with migrations or EnsureCreated), a memory-optimized table will be created for these entities.

[!code-csharpIsMemoryOptimized]