From 377f747a93648f48b9f468fb8ab2a37ae4cbcb75 Mon Sep 17 00:00:00 2001 From: Jos de Bruijn Date: Thu, 8 Dec 2016 08:53:44 -0800 Subject: [PATCH] changing defaults to show better profile across different hardware --- .../ticket-reservations/DemoWorkload/App.Config | 4 ++-- .../dbo/Stored Procedures/InsertReservationDetails.sql | 6 ++++-- .../dbo/Tables/TicketReservationDetail.sql | 10 ++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/samples/features/in-memory/ticket-reservations/DemoWorkload/App.Config b/samples/features/in-memory/ticket-reservations/DemoWorkload/App.Config index c4912ea9..71429d91 100644 --- a/samples/features/in-memory/ticket-reservations/DemoWorkload/App.Config +++ b/samples/features/in-memory/ticket-reservations/DemoWorkload/App.Config @@ -10,10 +10,10 @@ - + - + diff --git a/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Stored Procedures/InsertReservationDetails.sql b/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Stored Procedures/InsertReservationDetails.sql index 56fda959..ee56ae59 100644 --- a/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Stored Procedures/InsertReservationDetails.sql +++ b/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Stored Procedures/InsertReservationDetails.sql @@ -1,4 +1,5 @@ -/* + +-- traditional T-SQL version of the stored procedure CREATE PROCEDURE InsertReservationDetails(@TicketReservationID int, @LineCount int, @Comment NVARCHAR(1000), @FlightID int) AS BEGIN @@ -10,9 +11,9 @@ BEGIN SET @loop += 1; END END -*/ +/* -- natively compiled version of the stored procedure: CREATE PROCEDURE InsertReservationDetails(@TicketReservationID int, @LineCount int, @Comment NVARCHAR(1000), @FlightID int) WITH NATIVE_COMPILATION, SCHEMABINDING @@ -28,3 +29,4 @@ BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL=SNAPSHOT, LANGUAGE=N'English') SET @loop += 1; END END +*/ \ No newline at end of file diff --git a/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Tables/TicketReservationDetail.sql b/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Tables/TicketReservationDetail.sql index b1e67e9d..61d80cd7 100644 --- a/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Tables/TicketReservationDetail.sql +++ b/samples/features/in-memory/ticket-reservations/TicketReservations/dbo/Tables/TicketReservationDetail.sql @@ -5,16 +5,18 @@ FlightID INT NOT NULL, Comment NVARCHAR (1000), -- disk-based table: -/* + CONSTRAINT [PK_TicketReservationDetail] PRIMARY KEY CLUSTERED (TicketReservationDetailID) ); -*/ +/* -- for memory-optimized, replace the last two lines with the following: - CONSTRAINT [PK_TicketReservationDetail] PRIMARY KEY NONCLUSTERED (TicketReservationDetailID) + CONSTRAINT [PK_TicketReservationDetail] PRIMARY KEY NONCLUSTERED HASH + ([TicketReservationDetailID]) WITH (BUCKET_COUNT=10000000) ) WITH (MEMORY_OPTIMIZED=ON); GO +*/ -- For SQL Server, include the following filegroup. For Azure DB, leave out the filegroup - ALTER DATABASE [$(DatabaseName)] ADD FILEGROUP [mod] CONTAINS MEMORY_OPTIMIZED_DATA +-- ALTER DATABASE [$(DatabaseName)] ADD FILEGROUP [mod] CONTAINS MEMORY_OPTIMIZED_DATA