MS Sql Server Memory Optimized Table

You will need to SQL 2012 or higher compatible database and need to create a Memory filestream object for your database.

https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/creating-a-memory-optimized-table-and-a-natively-compiled-stored-procedure

There are several restrictions on data types and indexes

  • No clustered keys
  • No varchar(max) fields
  • No spatial or computed types
  • No foreign keys

Use it as a cache for slow computation values and you will be ok

/****** Object: Table [dbo].[LocationComputedDetails] Script Date: 3/27/2017 9:55:34 AM ******/
DROP TABLE [dbo].[LocationComputedDetails]
GO
/****** Object: Table [dbo].[LocationComputedDetails] Script Date: 3/27/2017 9:55:34 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LocationComputedDetails]
(
	[Id] [int] NOT NULL,
	[Other] [int] NULL,
	[Name] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Code] [varchar](5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Line1] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Urban] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[GeoRegion] [varchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DetailedGeoRegion] [varchar](16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

 CONSTRAINT [PK_LocationComputedDetails_Id] PRIMARY KEY NONCLUSTERED 
(
	[Id] ASC
),
INDEX [LocationComputedDetails_Id] NONCLUSTERED HASH 
(
	[Id]
)WITH ( BUCKET_COUNT = 131072)
)WITH ( MEMORY_OPTIMIZED = ON , DURABILITY = SCHEMA_AND_DATA )
GO