Microsoft introduced in-memory OLTP in SQL Server 2014, advertising that queries can be up to 100 times faster. In this blog series I will explain the design principles of the in-memory OLTP engine to explain why it has the potential to be significantly faster than the traditional on-disk engine.
Before executing a T-SQL command the first time, SQL Server must always create a query plan. The evaluation of different permutations to find a good execution plan costs memory, CPU cycles and compile time. Let us create and execute the following stored procedure to better understand this.

USE AdventureWorks2017;
GO

SET STATISTICS TIME ON;
GO

DROP PROCEDURE IF EXISTS interpreted;
GO

CREATE PROCEDURE interpreted
AS
	BEGIN
		SELECT *
		FROM
			Production.Product AS pr
		LEFT JOIN
			Production.ProductSubcategory AS su
		ON
			pr.ProductSubcategoryID = su.ProductSubcategoryID
		LEFT JOIN
			Sales.SalesOrderDetail AS de
		ON
			de.ProductID = pr.ProductID
		LEFT JOIN
			Production.ProductSubcategory
		ON
			pr.ProductSubcategoryID = pr.ProductSubcategoryID
		INNER JOIN
			Sales.SpecialOffer AS soff
		ON
			de.SpecialOfferID = soff.SpecialOfferID
		LEFT JOIN
			Sales.SalesOrderHeader AS he
		ON
			he.SalesOrderID = de.SalesOrderID
		LEFT JOIN
			Sales.Customer AS cu
		ON
			he.CustomerID = cu.CustomerID
		LEFT JOIN
			Sales.SalesPerson AS per
		ON
			per.BusinessEntityID = he.SalesPersonID
		LEFT OUTER JOIN
			Sales.SalesTerritory AS ter
		ON
			he.TerritoryID = ter.TerritoryID
		LEFT JOIN
			Person.Address AS ag
		ON
			he.ShipToAddressID = ag.AddressID
		WHERE
			pr.ProductID = 712;
	END;
GO
SET STATISTICS TIME ON; 
GO 

-- Clear the plan cache for the current database 
DECLARE @db_id int = DB_ID(