mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Remove extra spacing
This commit is contained in:
+2
-2
@@ -19,14 +19,14 @@ Some results from this benchmark:
|
||||
|
||||
## Running this sample
|
||||
|
||||
1. Create the database, tables, and stored procedures using the T-SQL scripts in the corresponding subfolders.
|
||||
1. Create the database, tables, and stored procedures using the T-SQL scripts in the corresponding subfolders.
|
||||
|
||||
- The hash indexes are sized for a scale factor of 100, which translates to a 24GB database, with bucket_count double the row count. For larger database and memory size, adjust the bucket counts accordingly.
|
||||
- The max bucket_count in SQL Server 2016 is 1 billion. It is OK to have a higher row count. The benchmark performs well with bucket_count of 1 billion and row counts of 5 billion.
|
||||
- There are plans to publish scripts for initial populate of the tables. Timeline is TBD.
|
||||
- Scripts are also provided for corresponding disk-based tables and traditional stored procedures, to compare performance between disk-based and memory-optimized tables.
|
||||
- Data size across the tables is distributed as follows:
|
||||
|
||||
|
||||
|Table|Weight|
|
||||
|----------|--------|
|
||||
|Customer|1|
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
-- With SQL Server, make sure SQL Server authentication is enabled, and the sa account is active
|
||||
|
||||
-- create main database files; for large-scale workloads, add additional containers to the DiskBased_fg filegroup
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
BEGIN
|
||||
DECLARE @sql nvarchar(max) = N'
|
||||
CREATE DATABASE DiskBasedDB
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
----------------------------------------------------------------------------
|
||||
USE DiskBasedDB
|
||||
GO
|
||||
|
||||
|
||||
---
|
||||
--- Set connection attributes
|
||||
---
|
||||
@@ -23,7 +23,7 @@ GO
|
||||
IF NOT EXISTS ( SELECT name FROM sysindexes WHERE name = 'PK_CUSTOMER' )
|
||||
CREATE UNIQUE CLUSTERED INDEX PK_CUSTOMER ON Customer( C_ID )
|
||||
WITH (FILLFACTOR = 100, SORT_IN_TEMPDB=ON, MAXDOP = 8)
|
||||
ON DiskBased_fg
|
||||
ON DiskBased_fg
|
||||
GO
|
||||
|
||||
CHECKPOINT
|
||||
@@ -43,7 +43,7 @@ GO
|
||||
IF NOT EXISTS ( SELECT name FROM sysindexes WHERE name = 'PK_ORDERLINES' )
|
||||
CREATE CLUSTERED INDEX PK_ORDERLINES ON OrderLines( OL_O_ID )
|
||||
WITH (FILLFACTOR = 100, SORT_IN_TEMPDB=ON, MAXDOP = 8)
|
||||
|
||||
|
||||
GO
|
||||
|
||||
IF NOT EXISTS ( SELECT name FROM sysindexes WHERE name = 'IX_ORDERLINES_NC1' )
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
-- With SQL Server, make sure SQL Server authentication is enabled, and the sa account is active
|
||||
|
||||
-- create main database files; for large-scale workloads, add additional containers in the InMem_fg filegroup
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
BEGIN
|
||||
DECLARE @sql nvarchar(max) = N'
|
||||
CREATE DATABASE InMemDB
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ CREATE TABLE dbo.Orders(
|
||||
CONSTRAINT PK_Orders PRIMARY KEY NONCLUSTERED HASH ( O_ID )
|
||||
WITH (BUCKET_COUNT = 10000000),
|
||||
|
||||
INDEX IX_Orders_DTS (O_FM_DTS, O_DTS ASC)
|
||||
INDEX IX_Orders_DTS (O_FM_DTS, O_DTS ASC)
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
+9
-9
@@ -62,7 +62,7 @@ BEGIN
|
||||
@o_id bigint,
|
||||
@o_total decimal(9,2),
|
||||
@o_dts datetime
|
||||
|
||||
|
||||
|
||||
SELECT @c_f_name = C_F_NAME,
|
||||
@c_l_name = C_L_NAME,
|
||||
@@ -83,7 +83,7 @@ BEGIN
|
||||
OL_PRICE
|
||||
FROM dbo.OrderLines
|
||||
WHERE OL_O_ID = @o_id
|
||||
|
||||
|
||||
SELECT @c_f_name,
|
||||
@c_l_name,
|
||||
@c_email
|
||||
@@ -108,7 +108,7 @@ BEGIN
|
||||
FROM dbo.Products
|
||||
WHERE PR_TYPE = @REQ_TYPE
|
||||
ORDER BY PR_PRICE ASC
|
||||
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -172,7 +172,7 @@ BEGIN
|
||||
|
||||
--insert an Order record to claim the O_ID
|
||||
INSERT INTO dbo.Orders (O_C_ID, O_TOTAL, O_DTS, O_FM_DTS) VALUES (@C_ID, 0, GETDATE(), @NullDate)
|
||||
|
||||
|
||||
-- get the inserted order id
|
||||
SELECT @order_id = SCOPE_IDENTITY()
|
||||
|
||||
@@ -188,7 +188,7 @@ BEGIN
|
||||
@PR_Qty = @OL_PR_QTY_1,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_1
|
||||
WHERE PR_ID = @OL_PR_ID_1
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -204,7 +204,7 @@ BEGIN
|
||||
@PR_Qty = @OL_PR_QTY_2,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_2
|
||||
WHERE PR_ID = @OL_PR_ID_2
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -220,7 +220,7 @@ BEGIN
|
||||
@PR_Qty = @OL_PR_QTY_3,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_3
|
||||
WHERE PR_ID = @OL_PR_ID_3
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -236,7 +236,7 @@ BEGIN
|
||||
@PR_Qty = @OL_PR_QTY_4,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_4
|
||||
WHERE PR_ID = @OL_PR_ID_4
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -252,7 +252,7 @@ BEGIN
|
||||
@PR_Qty = @OL_PR_QTY_5,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_5
|
||||
WHERE PR_ID = @OL_PR_ID_5
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
|
||||
+10
-10
@@ -45,7 +45,7 @@ AS BEGIN ATOMIC WITH
|
||||
|
||||
-- insert the data into the FulFillment table
|
||||
INSERT INTO dbo.Fulfillment (FM_O_ID, FM_C_ID, FM_DTS) VALUES (@OrderID, @OrderCID, @FulfillmentDate)
|
||||
|
||||
|
||||
SELECT @OrderID AS 'OrderID Fulfilled'
|
||||
END
|
||||
|
||||
@@ -72,7 +72,7 @@ AS BEGIN ATOMIC WITH
|
||||
@o_id bigint,
|
||||
@o_total decimal(9,2),
|
||||
@o_dts datetime
|
||||
|
||||
|
||||
|
||||
SELECT @c_f_name = C_F_NAME,
|
||||
@c_l_name = C_L_NAME,
|
||||
@@ -93,7 +93,7 @@ AS BEGIN ATOMIC WITH
|
||||
OL_PRICE
|
||||
FROM dbo.OrderLines
|
||||
WHERE OL_O_ID = @o_id
|
||||
|
||||
|
||||
SELECT @c_f_name,
|
||||
@c_l_name,
|
||||
@c_email
|
||||
@@ -123,7 +123,7 @@ AS BEGIN ATOMIC WITH
|
||||
FROM dbo.Products
|
||||
WHERE PR_TYPE = @REQ_TYPE
|
||||
ORDER BY PR_PRICE ASC
|
||||
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -195,7 +195,7 @@ AS BEGIN ATOMIC WITH
|
||||
|
||||
--insert an Order record to claim the O_ID
|
||||
INSERT INTO dbo.Orders (O_C_ID, O_TOTAL, O_DTS, O_FM_DTS) VALUES (@C_ID, 0, GETDATE(), @NullDate)
|
||||
|
||||
|
||||
-- get the inserted order id
|
||||
SELECT @order_id = SCOPE_IDENTITY()
|
||||
|
||||
@@ -211,7 +211,7 @@ AS BEGIN ATOMIC WITH
|
||||
@PR_Qty = @OL_PR_QTY_1,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_1
|
||||
WHERE PR_ID = @OL_PR_ID_1
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -227,7 +227,7 @@ AS BEGIN ATOMIC WITH
|
||||
@PR_Qty = @OL_PR_QTY_2,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_2
|
||||
WHERE PR_ID = @OL_PR_ID_2
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -243,7 +243,7 @@ AS BEGIN ATOMIC WITH
|
||||
@PR_Qty = @OL_PR_QTY_3,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_3
|
||||
WHERE PR_ID = @OL_PR_ID_3
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -259,7 +259,7 @@ AS BEGIN ATOMIC WITH
|
||||
@PR_Qty = @OL_PR_QTY_4,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_4
|
||||
WHERE PR_ID = @OL_PR_ID_4
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
@@ -275,7 +275,7 @@ AS BEGIN ATOMIC WITH
|
||||
@PR_Qty = @OL_PR_QTY_5,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_5
|
||||
WHERE PR_ID = @OL_PR_ID_5
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
|
||||
@@ -47,7 +47,7 @@ Script to add In-Memory Analytics (Columnstore) to the AdventureWorksLT sample d
|
||||
|
||||
**[clustered_columnstore_sample_queries.sql](clustered_columnstore_sample_queries.sql)**
|
||||
|
||||
T-SQL queries accompanying the In-Memory Analytics (Columnstore) sample in the AdventureWorksLT sample database for Azure SQL Database.
|
||||
T-SQL queries accompanying the In-Memory Analytics (Columnstore) sample in the AdventureWorksLT sample database for Azure SQL Database.
|
||||
|
||||
<a name=related-links></a>
|
||||
|
||||
|
||||
+13
-13
@@ -1,15 +1,15 @@
|
||||
/*************************************************************************
|
||||
This sample targets DataWarehouse workload. We recommend using clustered
|
||||
This sample targets DataWarehouse workload. We recommend using clustered
|
||||
columnstore index for large tables (million+) rows and traditional rowstore
|
||||
for tables of size < 1 million rows. The examples here are based on star schema
|
||||
consisting of FACT and DIMENSION tables.The examples hi-light the both the
|
||||
consisting of FACT and DIMENSION tables.The examples hi-light the both the
|
||||
storage savings and performance enhancements available in Azure SQL DB
|
||||
|
||||
We have two fact tables FactResellerSalesXL_CCI and FactResellerSalesXL_PageCompressed.
|
||||
They are identical except one table is based on clustered columnstore index
|
||||
and other table is regular rowstore table with PAGE compression
|
||||
|
||||
Note: A Pre-requisite is following the instructions in the document:
|
||||
Note: A Pre-requisite is following the instructions in the document:
|
||||
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-in-memory#2-install-the-in-memory-analytics-sample
|
||||
*************************************************************************
|
||||
*/
|
||||
@@ -18,7 +18,7 @@
|
||||
/*************************************************************************************
|
||||
STEP 1 - Space comparison between CCI and PAGE compressed table
|
||||
**********************************************************************************/
|
||||
-- How about space? Data space is much smaller. One key point to note is that PAGE compression can
|
||||
-- How about space? Data space is much smaller. One key point to note is that PAGE compression can
|
||||
-- compress 2-4x. The difference is less as we have a Primary Key on the table that creates a Unique Non-clustered index
|
||||
-- The actual data compression savings will depend upon the data and the schema
|
||||
sp_spaceused 'FactResellerSalesXL_CCI'
|
||||
@@ -78,7 +78,7 @@ SET STATISTICS TIME OFF
|
||||
GO
|
||||
|
||||
|
||||
-- This is the same Prior query on a table with a Clustered Columnstore index CCI
|
||||
-- This is the same Prior query on a table with a Clustered Columnstore index CCI
|
||||
-- The comparison numbers are even more dramatic the larger the table is, this is a 11 million row table only.
|
||||
SET STATISTICS IO ON
|
||||
SET STATISTICS TIME ON
|
||||
@@ -112,7 +112,7 @@ GO
|
||||
STEP 3 - Constraints
|
||||
*********************************************************************************
|
||||
*/
|
||||
-- SQL 2014 did not support foreign Key constraints..
|
||||
-- SQL 2014 did not support foreign Key constraints..
|
||||
-- Validate there are constraints on this table
|
||||
SELECT * FROM sys.indexes WHERE object_id = object_id('FactResellerSalesXL_CCI')
|
||||
SELECT * FROM sys.foreign_keys WHERE parent_object_id = object_id('FactResellerSalesXL_CCI')
|
||||
@@ -317,7 +317,7 @@ GO
|
||||
|
||||
|
||||
/*************************************************************************************
|
||||
STEP 8 - Non-Clustered Indexes ( btree) on top of Clustered columnstore index
|
||||
STEP 8 - Non-Clustered Indexes ( btree) on top of Clustered columnstore index
|
||||
**********************************************************************************/
|
||||
-- What abount narrow lookups
|
||||
-- See missing index for this Plan
|
||||
@@ -342,7 +342,7 @@ GO
|
||||
|
||||
|
||||
/* Now create the missing index */
|
||||
CREATE NONCLUSTERED INDEX IndFactResellerSalesXL_CCI_NCI
|
||||
CREATE NONCLUSTERED INDEX IndFactResellerSalesXL_CCI_NCI
|
||||
ON [dbo].[FactResellerSalesXL_CCI] ([ProductKey])
|
||||
INCLUDE ([SalesAmount],[OrderDate])
|
||||
GO
|
||||
@@ -370,7 +370,7 @@ GO
|
||||
DROP INDEX IF EXISTS [FactResellerSales_CCI].IndFactResellerSales_CCI_NCI;
|
||||
|
||||
/*************************************************************************************
|
||||
STEP 9 - Read Committed Snapshot Isolation
|
||||
STEP 9 - Read Committed Snapshot Isolation
|
||||
**********************************************************************************/
|
||||
-- RCSI now supported now, which means you can have CCI on AlwaysOn secondaries
|
||||
-- Note this may be blocked if you have other connections opened
|
||||
@@ -440,7 +440,7 @@ SELECT TOP 400000 * FROM FactResellerSalesXL_CCI
|
||||
|
||||
|
||||
-- check the rowgroups created.
|
||||
-- you will notice each thread creates its own delta rowgroup. The compressed rowgproup will only be created
|
||||
-- you will notice each thread creates its own delta rowgroup. The compressed rowgproup will only be created
|
||||
-- if number of rows inserted by a thread is > 100k
|
||||
SELECT * FROM sys.dm_db_column_store_row_group_physical_stats
|
||||
WHERE object_id = object_id('FactResellerSalesXL_CCI_temp')
|
||||
@@ -459,7 +459,7 @@ SELECT * FROM sys.dm_db_column_store_row_group_physical_stats
|
||||
WHERE object_id = object_id('FactResellerSalesXL_CCI_temp')
|
||||
|
||||
|
||||
-- Now delete a subset of rows
|
||||
-- Now delete a subset of rows
|
||||
DELETE FactResellerSalesXL_CCI_temp WHERE productkey % 2 = 0
|
||||
|
||||
-- run the following DMV to note the deleted rows
|
||||
@@ -469,10 +469,10 @@ WHERE object_id = object_id('FactResellerSalesXL_CCI_temp')
|
||||
|
||||
-- we will now run REORG command to defragement the columnstore index by removing deleted rows
|
||||
-- This will MERGE smaller rowgroups into larger rowgroups and also reclaim space from the deleted rows
|
||||
-- http://blogs.msdn.com/b/sqlcat/archive/2015/08/17/sql-2016-columnstore-row-group-merge-policy-and-index-maintenance-improvements.aspx
|
||||
-- http://blogs.msdn.com/b/sqlcat/archive/2015/08/17/sql-2016-columnstore-row-group-merge-policy-and-index-maintenance-improvements.aspx
|
||||
ALTER INDEX cci_temp on FactResellerSalesXL_CCI_temp REORGANIZE
|
||||
|
||||
-- Validate the new rowgroups that were merged
|
||||
-- Validate the new rowgroups that were merged
|
||||
-- Note only look at the COMPRESSED rowgroup.
|
||||
SELECT * FROM sys.dm_db_column_store_row_group_physical_stats
|
||||
WHERE object_id = object_id('FactResellerSalesXL_CCI_temp')
|
||||
|
||||
+14
-14
@@ -1,12 +1,12 @@
|
||||
-- The below scipt enables the use of In-Memory OLTP in the current database,
|
||||
-- The below scipt enables the use of In-Memory OLTP in the current database,
|
||||
-- provided it is supported in the edition / pricing tier of the database.
|
||||
-- It does the following:
|
||||
-- 1. Validate that In-Memory OLTP is supported.
|
||||
-- 1. Validate that In-Memory OLTP is supported.
|
||||
-- 2. In SQL Server, it will add a MEMORY_OPTIMIZED_DATA filegroup to the database
|
||||
-- and create a container within the filegroup in the default data folder.
|
||||
-- 3. Change the database compatibility level to 130 (needed for parallel queries
|
||||
-- and auto-update of statistics).
|
||||
-- 4. Enables the database option MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT to avoid the
|
||||
-- 4. Enables the database option MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT to avoid the
|
||||
-- need to use the WITH (SNAPSHOT) hint for ad hoc queries accessing memory-optimized
|
||||
-- tables.
|
||||
--
|
||||
@@ -18,19 +18,19 @@ SET NOCOUNT ON;
|
||||
SET XACT_ABORT ON;
|
||||
|
||||
-- 1. validate that In-Memory OLTP is supported
|
||||
IF SERVERPROPERTY(N'IsXTPSupported') = 0
|
||||
BEGIN
|
||||
IF SERVERPROPERTY(N'IsXTPSupported') = 0
|
||||
BEGIN
|
||||
PRINT N'Error: In-Memory OLTP is not supported for this server edition or database pricing tier.';
|
||||
END
|
||||
END
|
||||
IF DB_ID() < 5
|
||||
BEGIN
|
||||
BEGIN
|
||||
PRINT N'Error: In-Memory OLTP is not supported in system databases. Connect to a user database.';
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
BEGIN TRY;
|
||||
-- 2. add MEMORY_OPTIMIZED_DATA filegroup when not using Azure SQL DB
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
IF SERVERPROPERTY('EngineEdition') != 5
|
||||
BEGIN
|
||||
DECLARE @SQLDataFolder nvarchar(max) = cast(SERVERPROPERTY('InstanceDefaultDataPath') as nvarchar(max))
|
||||
DECLARE @MODName nvarchar(max) = DB_NAME() + N'_mod';
|
||||
@@ -42,7 +42,7 @@ BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM sys.filegroups WHERE type = N'FX')
|
||||
BEGIN
|
||||
SET @SQL = N'
|
||||
ALTER DATABASE CURRENT
|
||||
ALTER DATABASE CURRENT
|
||||
ADD FILEGROUP ' + QUOTENAME(@MODName) + N' CONTAINS MEMORY_OPTIMIZED_DATA;';
|
||||
EXECUTE (@SQL);
|
||||
|
||||
@@ -54,7 +54,7 @@ ADD FILEGROUP ' + QUOTENAME(@MODName) + N' CONTAINS MEMORY_OPTIMIZED_DATA;';
|
||||
SET @SQL = N'
|
||||
ALTER DATABASE CURRENT
|
||||
ADD FILE (name = N''' + @MODName + ''', filename = '''
|
||||
+ @MemoryOptimizedFilegroupFolder + N''')
|
||||
+ @MemoryOptimizedFilegroupFolder + N''')
|
||||
TO FILEGROUP ' + QUOTENAME(@MODName);
|
||||
EXECUTE (@SQL);
|
||||
END
|
||||
@@ -62,7 +62,7 @@ TO FILEGROUP ' + QUOTENAME(@MODName);
|
||||
|
||||
-- 3. set compat level to 130 if it is lower
|
||||
IF (SELECT compatibility_level FROM sys.databases WHERE database_id=DB_ID()) < 130
|
||||
ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL = 130
|
||||
ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL = 130
|
||||
|
||||
-- 4. enable MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT for the database
|
||||
ALTER DATABASE CURRENT SET MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = ON;
|
||||
|
||||
+20
-20
@@ -20,7 +20,7 @@ CREATE TABLE [dbo].[DimGeography](
|
||||
[StateProvinceName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[CountryRegionName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[PostalCode] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GeographyKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
@@ -28,7 +28,7 @@ CREATE TABLE [dbo].[DimGeography](
|
||||
GO
|
||||
-- Populate Data
|
||||
insert into DimGeography
|
||||
select distinct AddressID,City,StateProvince,CountryRegion,PostalCode
|
||||
select distinct AddressID,City,StateProvince,CountryRegion,PostalCode
|
||||
from SalesLT.Address
|
||||
|
||||
-- select * from DimGeography
|
||||
@@ -50,7 +50,7 @@ CREATE TABLE [dbo].[DimCustomer](
|
||||
[LastName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[Suffix] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[EmailAddress] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
|
||||
CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[CustomerKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
@@ -90,7 +90,7 @@ CREATE TABLE [dbo].[DimDate](
|
||||
[MonthNumberOfYear] [tinyint] NOT NULL,
|
||||
[EnglishMonthName] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[Year] [smallint] NOT NULL
|
||||
CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[DateKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
@@ -109,11 +109,11 @@ AS
|
||||
SELECT @StartDate AS [DateKey]
|
||||
UNION ALL
|
||||
SELECT DATEADD(DAY,1,[DateKey])
|
||||
FROM DateList
|
||||
FROM DateList
|
||||
WHERE DATEADD(DAY,1,[DateKey]) <= @EndDate
|
||||
)
|
||||
Insert into DimDate
|
||||
select
|
||||
select
|
||||
[DateKey]= Cast(CONVERT(VARCHAR,[DateKey],112) as int) --YYYYMMDD
|
||||
,[FullDateAlternateKey] = [DateKey]
|
||||
-- week
|
||||
@@ -127,7 +127,7 @@ select
|
||||
-- Year
|
||||
, [MonthNumberOfYear] = DATEPART(MONTH, [DateKey])
|
||||
, [EnglishMonthName] = DATENAME(MONTH, [DateKey])
|
||||
|
||||
|
||||
|
||||
,[Year] = YEAR([DateKey])
|
||||
--into tbltest
|
||||
@@ -160,11 +160,11 @@ CREATE TABLE [dbo].[DimProductCategory](
|
||||
[ProductCategoryKey] [int] IDENTITY(1,1) NOT NULL,
|
||||
[ProductCategoryAlternateKey] [int] NULL,
|
||||
[EnglishProductCategoryName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ProductCategoryKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),
|
||||
CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED
|
||||
CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED
|
||||
(
|
||||
[ProductCategoryAlternateKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
@@ -190,11 +190,11 @@ CREATE TABLE [dbo].[DimProductSubcategory](
|
||||
[ProductSubcategoryAlternateKey] [int] NULL,
|
||||
[EnglishProductSubcategoryName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[ProductCategoryKey] [int] NULL,
|
||||
CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ProductSubcategoryKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),
|
||||
CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED
|
||||
CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED
|
||||
(
|
||||
[ProductSubcategoryAlternateKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
@@ -234,11 +234,11 @@ CREATE TABLE [dbo].[DimProduct](
|
||||
[ProductModel] [nvarchar](400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[StartDate] [datetime] NULL,
|
||||
[EndDate] [datetime] NULL
|
||||
CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ProductKey] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),
|
||||
CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED
|
||||
CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED
|
||||
(
|
||||
[ProductAlternateKey] ASC,
|
||||
[StartDate] ASC
|
||||
@@ -325,7 +325,7 @@ CREATE TABLE [dbo].[FactResellerSalesXL_PageCompressed](
|
||||
[ShipDate] [smalldatetime] NULL
|
||||
)
|
||||
GO
|
||||
ALTER TABLE [dbo].[FactResellerSalesXL_PageCompressed] WITH CHECK ADD
|
||||
ALTER TABLE [dbo].[FactResellerSalesXL_PageCompressed] WITH CHECK ADD
|
||||
CONSTRAINT [PK_FactResellerSalesXL_PageCompressed_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[SalesOrderNumber] ASC,
|
||||
@@ -365,14 +365,14 @@ Declare @OrderDateKey int,
|
||||
@NumOrdersPerDateKey int,
|
||||
@NumSalesLineItems int
|
||||
|
||||
Declare @CustomerPONumber nvarchar(25),@CarrierTrackingNumber nvarchar(25)
|
||||
Declare @CustomerPONumber nvarchar(25),@CarrierTrackingNumber nvarchar(25)
|
||||
|
||||
-- Loop through each Date Key to insert that many rows.
|
||||
DECLARE mycursor CURSOR
|
||||
FOR SELECT NumOrdersPerDay,DateKey,FullDateAlternateKey from #temp
|
||||
FOR SELECT NumOrdersPerDay,DateKey,FullDateAlternateKey from #temp
|
||||
|
||||
OPEN mycursor
|
||||
FETCH NEXT FROM mycursor
|
||||
FETCH NEXT FROM mycursor
|
||||
INTO @NumOrdersPerDateKey, @OrderDateKey,@OrderDate
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
@@ -427,7 +427,7 @@ BEGIN TRAN
|
||||
END
|
||||
COMMIT
|
||||
|
||||
FETCH NEXT FROM mycursor
|
||||
FETCH NEXT FROM mycursor
|
||||
INTO @NumOrdersPerDateKey, @OrderDateKey,@OrderDate
|
||||
END
|
||||
|
||||
@@ -444,8 +444,8 @@ CREATE CLUSTERED COLUMNSTORE INDEX [IndFactResellerSales_CCI] ON [dbo].[FactRese
|
||||
GO
|
||||
|
||||
-- Create Constraints
|
||||
ALTER TABLE [dbo].[FactResellerSalesXL_CCI] WITH CHECK ADD
|
||||
CONSTRAINT [PK_FactResellerSalesXL_CCI_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY
|
||||
ALTER TABLE [dbo].[FactResellerSalesXL_CCI] WITH CHECK ADD
|
||||
CONSTRAINT [PK_FactResellerSalesXL_CCI_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY
|
||||
(
|
||||
[SalesOrderNumber] ASC,
|
||||
[SalesOrderLineNumber] ASC
|
||||
|
||||
+49
-49
@@ -3,14 +3,14 @@
|
||||
--
|
||||
-- Last updated: 2016-07-29
|
||||
--
|
||||
--
|
||||
--
|
||||
-- Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
--
|
||||
--
|
||||
-- This source code is intended only as a supplement to Microsoft
|
||||
-- Development Tools and/or on-line documentation.
|
||||
--
|
||||
-- THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
-- ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
-- Development Tools and/or on-line documentation.
|
||||
--
|
||||
-- THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
-- ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
-- PARTICULAR PURPOSE.
|
||||
|
||||
@@ -28,16 +28,16 @@ GO
|
||||
|
||||
ALTER DATABASE CURRENT SET MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = ON
|
||||
GO
|
||||
ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL = 130
|
||||
ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL = 130
|
||||
GO
|
||||
|
||||
/*************************** Create Tables **********************************/
|
||||
|
||||
-- first drop all objects that have a schema-bound dependency on the table
|
||||
|
||||
DROP PROCEDURE IF EXISTS [SalesLT].usp_InsertSalesOrder_inmem
|
||||
DROP PROCEDURE IF EXISTS [SalesLT].usp_InsertSalesOrder_inmem
|
||||
GO
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderHeader_inmem]
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderHeader_inmem]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[SalesOrderHeader_inmem](
|
||||
[SalesOrderID] int IDENTITY NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT=100000),
|
||||
@@ -46,7 +46,7 @@ CREATE TABLE [SalesLT].[SalesOrderHeader_inmem](
|
||||
[DueDate] [datetime2] NOT NULL,
|
||||
[ShipDate] [datetime2] NULL,
|
||||
[Status] [tinyint] NOT NULL CONSTRAINT [IMDF_SalesOrderHeader_Status] DEFAULT ((1)),
|
||||
[OnlineOrderFlag] bit NOT NULL CONSTRAINT [IMDF_SalesOrderHeader_OnlineOrderFlag] DEFAULT ((1)),
|
||||
[OnlineOrderFlag] bit NOT NULL CONSTRAINT [IMDF_SalesOrderHeader_OnlineOrderFlag] DEFAULT ((1)),
|
||||
[PurchaseOrderNumber] nvarchar(25) NULL,
|
||||
[AccountNumber] nvarchar(15) NULL,
|
||||
[CustomerID] [int] NOT NULL ,
|
||||
@@ -63,7 +63,7 @@ CREATE TABLE [SalesLT].[SalesOrderHeader_inmem](
|
||||
) WITH (MEMORY_OPTIMIZED=ON)
|
||||
GO
|
||||
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderDetail_inmem]
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderDetail_inmem]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[SalesOrderDetail_inmem](
|
||||
[SalesOrderID] int NOT NULL INDEX IX_SalesOrderID HASH WITH (BUCKET_COUNT=100000),
|
||||
@@ -74,7 +74,7 @@ CREATE TABLE [SalesLT].[SalesOrderDetail_inmem](
|
||||
[UnitPriceDiscount] [money] NOT NULL CONSTRAINT [IMDF_SalesOrderDetail_UnitPriceDiscount] DEFAULT ((0.0)),
|
||||
[ModifiedDate] [datetime2] NOT NULL ,
|
||||
|
||||
CONSTRAINT [imPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY NONCLUSTERED HASH
|
||||
CONSTRAINT [imPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY NONCLUSTERED HASH
|
||||
( [SalesOrderID],
|
||||
[SalesOrderDetailID]
|
||||
)WITH (BUCKET_COUNT=1000000)
|
||||
@@ -83,7 +83,7 @@ GO
|
||||
|
||||
|
||||
-- type used for TVPs when creating new sales orders
|
||||
DROP TYPE IF EXISTS [SalesLT].[SalesOrderDetailType_inmem]
|
||||
DROP TYPE IF EXISTS [SalesLT].[SalesOrderDetailType_inmem]
|
||||
GO
|
||||
CREATE TYPE [SalesLT].[SalesOrderDetailType_inmem] AS TABLE(
|
||||
[OrderQty] [smallint] NOT NULL,
|
||||
@@ -93,7 +93,7 @@ GO
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS [SalesLT].[Product_inmem]
|
||||
DROP TABLE IF EXISTS [SalesLT].[Product_inmem]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[Product_inmem](
|
||||
[ProductID] [int] IDENTITY NOT NULL,
|
||||
@@ -111,11 +111,11 @@ CREATE TABLE [SalesLT].[Product_inmem](
|
||||
[ModifiedDate] [datetime2] NOT NULL CONSTRAINT [IMDF_Product_ModifiedDate] DEFAULT (SYSDATETIME()),
|
||||
|
||||
CONSTRAINT [IMPK_Product_ProductID] PRIMARY KEY NONCLUSTERED
|
||||
( [ProductID] )
|
||||
( [ProductID] )
|
||||
) WITH (MEMORY_OPTIMIZED=ON)
|
||||
GO
|
||||
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderHeader_ondisk]
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderHeader_ondisk]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[SalesOrderHeader_ondisk](
|
||||
[SalesOrderID] int IDENTITY NOT NULL PRIMARY KEY,
|
||||
@@ -124,9 +124,9 @@ CREATE TABLE [SalesLT].[SalesOrderHeader_ondisk](
|
||||
[DueDate] [datetime2] NOT NULL,
|
||||
[ShipDate] [datetime2] NULL,
|
||||
[Status] [tinyint] NOT NULL CONSTRAINT [ODDF_SalesOrderHeader_Status] DEFAULT ((1)),
|
||||
[OnlineOrderFlag] bit NOT NULL CONSTRAINT [ODDF_SalesOrderHeader_OnlineOrderFlag] DEFAULT ((1)),
|
||||
[PurchaseOrderNumber] nvarchar(25) NULL,
|
||||
[AccountNumber] nvarchar(15) NULL,
|
||||
[OnlineOrderFlag] bit NOT NULL CONSTRAINT [ODDF_SalesOrderHeader_OnlineOrderFlag] DEFAULT ((1)),
|
||||
[PurchaseOrderNumber] nvarchar(25) NULL,
|
||||
[AccountNumber] nvarchar(15) NULL,
|
||||
[CustomerID] [int] NOT NULL ,
|
||||
[BillToAddressID] [int] NOT NULL,
|
||||
[ShipToAddressID] [int] NOT NULL,
|
||||
@@ -139,10 +139,10 @@ CREATE TABLE [SalesLT].[SalesOrderHeader_ondisk](
|
||||
|
||||
INDEX IX_CustomerID (CustomerID) ,
|
||||
INDEX IX_OrderDate (OrderDate ASC)
|
||||
)
|
||||
)
|
||||
GO
|
||||
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderDetail_ondisk]
|
||||
DROP TABLE IF EXISTS [SalesLT].[SalesOrderDetail_ondisk]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[SalesOrderDetail_ondisk](
|
||||
[SalesOrderID] int NOT NULL,
|
||||
@@ -153,15 +153,15 @@ CREATE TABLE [SalesLT].[SalesOrderDetail_ondisk](
|
||||
[UnitPriceDiscount] [money] NOT NULL CONSTRAINT [ODDF_SalesOrderDetail_UnitPriceDiscount] DEFAULT ((0.0)),
|
||||
[ModifiedDate] [datetime2] NOT NULL ,
|
||||
|
||||
CONSTRAINT [ODPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY
|
||||
CONSTRAINT [ODPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY
|
||||
( [SalesOrderID], [SalesOrderDetailID])
|
||||
)
|
||||
)
|
||||
GO
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_ondisk
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_ondisk
|
||||
GO
|
||||
DROP TYPE IF EXISTS [SalesLT].[SalesOrderDetailType_ondisk]
|
||||
DROP TYPE IF EXISTS [SalesLT].[SalesOrderDetailType_ondisk]
|
||||
GO
|
||||
CREATE TYPE [SalesLT].[SalesOrderDetailType_ondisk] AS TABLE(
|
||||
[OrderQty] [smallint] NOT NULL,
|
||||
@@ -172,7 +172,7 @@ GO
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS SalesLT.[Product_ondisk]
|
||||
DROP TABLE IF EXISTS SalesLT.[Product_ondisk]
|
||||
GO
|
||||
CREATE TABLE [SalesLT].[Product_ondisk](
|
||||
[ProductID] [int] IDENTITY NOT NULL,
|
||||
@@ -188,7 +188,7 @@ CREATE TABLE [SalesLT].[Product_ondisk](
|
||||
[SellEndDate] [datetime2] NULL,
|
||||
[DiscontinuedDate] [datetime2] NULL,
|
||||
[ModifiedDate] [datetime2] NOT NULL CONSTRAINT [ODDF_Product_ModifiedDate] DEFAULT (SYSDATETIME()),
|
||||
CONSTRAINT [ODPK_Product_ProductID] PRIMARY KEY CLUSTERED ([ProductID])
|
||||
CONSTRAINT [ODPK_Product_ProductID] PRIMARY KEY CLUSTERED ([ProductID])
|
||||
)
|
||||
GO
|
||||
|
||||
@@ -371,7 +371,7 @@ GO
|
||||
|
||||
/*************************** Create stored procedures **********************************/
|
||||
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_inmem
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_inmem
|
||||
GO
|
||||
CREATE PROCEDURE SalesLT.usp_InsertSalesOrder_inmem
|
||||
@SalesOrderID int OUTPUT,
|
||||
@@ -397,7 +397,7 @@ BEGIN ATOMIC WITH
|
||||
DECLARE @SubTotal money NOT NULL = 0
|
||||
|
||||
SELECT @SubTotal = ISNULL(SUM(p.ListPrice),0)
|
||||
FROM @SalesOrderDetails od
|
||||
FROM @SalesOrderDetails od
|
||||
JOIN SalesLT.Product_inmem p on od.ProductID=p.ProductID
|
||||
|
||||
INSERT INTO SalesLT.SalesOrderHeader_inmem
|
||||
@@ -442,7 +442,7 @@ BEGIN ATOMIC WITH
|
||||
UnitPriceDiscount,
|
||||
ModifiedDate
|
||||
)
|
||||
SELECT
|
||||
SELECT
|
||||
@SalesOrderID,
|
||||
od.OrderQty,
|
||||
od.ProductID,
|
||||
@@ -457,7 +457,7 @@ GO
|
||||
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_ondisk
|
||||
DROP PROCEDURE IF EXISTS SalesLT.usp_InsertSalesOrder_ondisk
|
||||
GO
|
||||
CREATE PROCEDURE SalesLT.usp_InsertSalesOrder_ondisk
|
||||
@SalesOrderID int OUTPUT,
|
||||
@@ -473,7 +473,7 @@ CREATE PROCEDURE SalesLT.usp_InsertSalesOrder_ondisk
|
||||
@CreditCardApprovalCode [varchar](15) = NULL,
|
||||
@Comment nvarchar(128) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
BEGIN
|
||||
BEGIN TRAN
|
||||
|
||||
DECLARE @OrderDate datetime2 = sysdatetime()
|
||||
@@ -481,7 +481,7 @@ BEGIN
|
||||
DECLARE @SubTotal money = 0
|
||||
|
||||
SELECT @SubTotal = ISNULL(SUM(p.ListPrice),0)
|
||||
FROM @SalesOrderDetails od
|
||||
FROM @SalesOrderDetails od
|
||||
JOIN SalesLT.Product_ondisk p on od.ProductID=p.ProductID
|
||||
|
||||
INSERT INTO SalesLT.SalesOrderHeader_ondisk
|
||||
@@ -526,7 +526,7 @@ BEGIN
|
||||
UnitPriceDiscount,
|
||||
ModifiedDate
|
||||
)
|
||||
SELECT
|
||||
SELECT
|
||||
@SalesOrderID,
|
||||
od.OrderQty,
|
||||
od.ProductID,
|
||||
@@ -544,22 +544,22 @@ GO
|
||||
|
||||
/*************************** Demo harness **********************************/
|
||||
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInsertSalesOrders
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInsertSalesOrders
|
||||
go
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInitSeed
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInitSeed
|
||||
GO
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderDetailSeed
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderDetailSeed
|
||||
GO
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderHeaderSeed
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderHeaderSeed
|
||||
GO
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoReset
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoReset
|
||||
GO
|
||||
DROP SCHEMA IF EXISTS Demo
|
||||
GO
|
||||
CREATE SCHEMA Demo
|
||||
GO
|
||||
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderDetailSeed
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderDetailSeed
|
||||
GO
|
||||
CREATE TABLE Demo.DemoSalesOrderDetailSeed
|
||||
(
|
||||
@@ -570,7 +570,7 @@ CREATE TABLE Demo.DemoSalesOrderDetailSeed
|
||||
) WITH (MEMORY_OPTIMIZED=ON)
|
||||
GO
|
||||
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderHeaderSeed
|
||||
DROP TABLE IF EXISTS Demo.DemoSalesOrderHeaderSeed
|
||||
GO
|
||||
CREATE TABLE Demo.DemoSalesOrderHeaderSeed
|
||||
(
|
||||
@@ -582,23 +582,23 @@ CREATE TABLE Demo.DemoSalesOrderHeaderSeed
|
||||
) WITH (MEMORY_OPTIMIZED=ON)
|
||||
GO
|
||||
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInitSeed
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoInitSeed
|
||||
GO
|
||||
CREATE PROCEDURE Demo.usp_DemoInitSeed @items_per_order int = 5
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @ProductID int,
|
||||
DECLARE @ProductID int,
|
||||
@i int = 1
|
||||
DECLARE @seed_order_count int = (SELECT COUNT(*)/@items_per_order FROM SalesLT.Product_inmem)
|
||||
|
||||
DECLARE seed_cursor CURSOR FOR
|
||||
SELECT
|
||||
DECLARE seed_cursor CURSOR FOR
|
||||
SELECT
|
||||
ProductID
|
||||
FROM SalesLT.Product_inmem WITH (SNAPSHOT)
|
||||
|
||||
OPEN seed_cursor
|
||||
|
||||
FETCH NEXT FROM seed_cursor
|
||||
FETCH NEXT FROM seed_cursor
|
||||
INTO @ProductID
|
||||
|
||||
BEGIN TRAN
|
||||
@@ -623,14 +623,14 @@ BEGIN
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
INSERT Demo.DemoSalesOrderDetailSeed
|
||||
SELECT
|
||||
SELECT
|
||||
@i % 6 + 1,
|
||||
@ProductID,
|
||||
@i % (@seed_order_count+1)
|
||||
|
||||
SET @i += 1
|
||||
|
||||
FETCH NEXT FROM seed_cursor
|
||||
FETCH NEXT FROM seed_cursor
|
||||
INTO @ProductID
|
||||
END
|
||||
|
||||
@@ -646,7 +646,7 @@ END
|
||||
GO
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoReset
|
||||
DROP PROCEDURE IF EXISTS Demo.usp_DemoReset
|
||||
GO
|
||||
CREATE PROCEDURE Demo.usp_DemoReset
|
||||
AS
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
||||
+36
-36
@@ -52,9 +52,9 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.TransactionCount)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ThreadCount)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
//
|
||||
// LabelReadsPerWrite
|
||||
//
|
||||
//
|
||||
this.LabelReadsPerWrite.AutoSize = true;
|
||||
this.LabelReadsPerWrite.BackColor = System.Drawing.Color.Transparent;
|
||||
this.LabelReadsPerWrite.Location = new System.Drawing.Point(14, 75);
|
||||
@@ -62,9 +62,9 @@
|
||||
this.LabelReadsPerWrite.Size = new System.Drawing.Size(84, 13);
|
||||
this.LabelReadsPerWrite.TabIndex = 48;
|
||||
this.LabelReadsPerWrite.Text = "Reads per Write";
|
||||
//
|
||||
//
|
||||
// ReadsPerWrite
|
||||
//
|
||||
//
|
||||
this.ReadsPerWrite.Location = new System.Drawing.Point(152, 73);
|
||||
this.ReadsPerWrite.Name = "ReadsPerWrite";
|
||||
this.ReadsPerWrite.Size = new System.Drawing.Size(99, 20);
|
||||
@@ -74,9 +74,9 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
//
|
||||
// LabelRowsPerTran
|
||||
//
|
||||
//
|
||||
this.LabelRowsPerTran.AutoSize = true;
|
||||
this.LabelRowsPerTran.BackColor = System.Drawing.Color.Transparent;
|
||||
this.LabelRowsPerTran.Location = new System.Drawing.Point(14, 179);
|
||||
@@ -84,9 +84,9 @@
|
||||
this.LabelRowsPerTran.Size = new System.Drawing.Size(111, 13);
|
||||
this.LabelRowsPerTran.TabIndex = 46;
|
||||
this.LabelRowsPerTran.Text = "Rows per Transaction";
|
||||
//
|
||||
//
|
||||
// RowCount
|
||||
//
|
||||
//
|
||||
this.RowCount.Location = new System.Drawing.Point(151, 177);
|
||||
this.RowCount.Maximum = new decimal(new int[] {
|
||||
5000000,
|
||||
@@ -106,9 +106,9 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
//
|
||||
// LabelRPT
|
||||
//
|
||||
//
|
||||
this.LabelRPT.AutoSize = true;
|
||||
this.LabelRPT.BackColor = System.Drawing.Color.Transparent;
|
||||
this.LabelRPT.Location = new System.Drawing.Point(14, 101);
|
||||
@@ -116,9 +116,9 @@
|
||||
this.LabelRPT.Size = new System.Drawing.Size(107, 13);
|
||||
this.LabelRPT.TabIndex = 44;
|
||||
this.LabelRPT.Text = "Requests per Thread";
|
||||
//
|
||||
//
|
||||
// RequestCount
|
||||
//
|
||||
//
|
||||
this.RequestCount.Location = new System.Drawing.Point(152, 99);
|
||||
this.RequestCount.Maximum = new decimal(new int[] {
|
||||
5000000,
|
||||
@@ -138,9 +138,9 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
//
|
||||
// lblInstance
|
||||
//
|
||||
//
|
||||
this.lblInstance.AutoSize = true;
|
||||
this.lblInstance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblInstance.Location = new System.Drawing.Point(14, 217);
|
||||
@@ -148,17 +148,17 @@
|
||||
this.lblInstance.Size = new System.Drawing.Size(91, 13);
|
||||
this.lblInstance.TabIndex = 42;
|
||||
this.lblInstance.Text = "Connection String";
|
||||
//
|
||||
//
|
||||
// tbConnectionString
|
||||
//
|
||||
//
|
||||
this.tbConnectionString.Location = new System.Drawing.Point(16, 243);
|
||||
this.tbConnectionString.Name = "tbConnectionString";
|
||||
this.tbConnectionString.Size = new System.Drawing.Size(271, 20);
|
||||
this.tbConnectionString.TabIndex = 40;
|
||||
this.tbConnectionString.TextChanged += new System.EventHandler(this.tbInstance_TextChanged);
|
||||
//
|
||||
//
|
||||
// label3
|
||||
//
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label3.Location = new System.Drawing.Point(14, 25);
|
||||
@@ -166,17 +166,17 @@
|
||||
this.label3.Size = new System.Drawing.Size(109, 13);
|
||||
this.label3.TabIndex = 38;
|
||||
this.label3.Text = "Max TPS (thousands)";
|
||||
//
|
||||
//
|
||||
// txtMaxTPS
|
||||
//
|
||||
//
|
||||
this.txtMaxTPS.Location = new System.Drawing.Point(152, 22);
|
||||
this.txtMaxTPS.Name = "txtMaxTPS";
|
||||
this.txtMaxTPS.Size = new System.Drawing.Size(99, 20);
|
||||
this.txtMaxTPS.TabIndex = 37;
|
||||
this.txtMaxTPS.TabStop = false;
|
||||
//
|
||||
//
|
||||
// lblRunningThread
|
||||
//
|
||||
//
|
||||
this.lblRunningThread.AutoSize = true;
|
||||
this.lblRunningThread.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblRunningThread.Location = new System.Drawing.Point(14, 50);
|
||||
@@ -184,18 +184,18 @@
|
||||
this.lblRunningThread.Size = new System.Drawing.Size(83, 13);
|
||||
this.lblRunningThread.TabIndex = 36;
|
||||
this.lblRunningThread.Text = "Max Latch Time";
|
||||
//
|
||||
//
|
||||
// txtMaxLatch
|
||||
//
|
||||
//
|
||||
this.txtMaxLatch.Location = new System.Drawing.Point(152, 47);
|
||||
this.txtMaxLatch.Name = "txtMaxLatch";
|
||||
this.txtMaxLatch.Size = new System.Drawing.Size(99, 20);
|
||||
this.txtMaxLatch.TabIndex = 35;
|
||||
this.txtMaxLatch.TabStop = false;
|
||||
this.txtMaxLatch.Text = "10000";
|
||||
//
|
||||
//
|
||||
// lblServerTran
|
||||
//
|
||||
//
|
||||
this.lblServerTran.AutoSize = true;
|
||||
this.lblServerTran.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblServerTran.Location = new System.Drawing.Point(14, 153);
|
||||
@@ -203,9 +203,9 @@
|
||||
this.lblServerTran.Size = new System.Drawing.Size(102, 13);
|
||||
this.lblServerTran.TabIndex = 34;
|
||||
this.lblServerTran.Text = "Server Transactions";
|
||||
//
|
||||
//
|
||||
// TransactionCount
|
||||
//
|
||||
//
|
||||
this.TransactionCount.Location = new System.Drawing.Point(152, 151);
|
||||
this.TransactionCount.Maximum = new decimal(new int[] {
|
||||
5000000,
|
||||
@@ -225,9 +225,9 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
//
|
||||
// lblThreadCnt
|
||||
//
|
||||
//
|
||||
this.lblThreadCnt.AutoSize = true;
|
||||
this.lblThreadCnt.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblThreadCnt.Location = new System.Drawing.Point(14, 127);
|
||||
@@ -235,9 +235,9 @@
|
||||
this.lblThreadCnt.Size = new System.Drawing.Size(46, 13);
|
||||
this.lblThreadCnt.TabIndex = 31;
|
||||
this.lblThreadCnt.Text = "Threads";
|
||||
//
|
||||
//
|
||||
// ThreadCount
|
||||
//
|
||||
//
|
||||
this.ThreadCount.Location = new System.Drawing.Point(152, 125);
|
||||
this.ThreadCount.Maximum = new decimal(new int[] {
|
||||
200,
|
||||
@@ -257,9 +257,9 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
//
|
||||
this.btnSave.Location = new System.Drawing.Point(16, 293);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(149, 23);
|
||||
@@ -267,9 +267,9 @@
|
||||
this.btnSave.Text = "Save Configuration Values";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
//
|
||||
//
|
||||
// FrmConfig
|
||||
//
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(310, 332);
|
||||
|
||||
+27
-27
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
+52
-52
@@ -72,9 +72,9 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.chtLatches)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chtCPU)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
//
|
||||
// btnRun
|
||||
//
|
||||
//
|
||||
this.btnRun.BackColor = System.Drawing.Color.White;
|
||||
this.btnRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnRun.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
@@ -86,9 +86,9 @@
|
||||
this.btnRun.Text = "Start";
|
||||
this.btnRun.UseVisualStyleBackColor = false;
|
||||
this.btnRun.Click += new System.EventHandler(this.OnRunClick);
|
||||
//
|
||||
//
|
||||
// btnStop
|
||||
//
|
||||
//
|
||||
this.btnStop.BackColor = System.Drawing.Color.White;
|
||||
this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
@@ -101,9 +101,9 @@
|
||||
this.btnStop.Text = "Stop";
|
||||
this.btnStop.UseVisualStyleBackColor = false;
|
||||
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
|
||||
//
|
||||
//
|
||||
// lbResults
|
||||
//
|
||||
//
|
||||
this.lbResults.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lbResults.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbResults.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(166)))));
|
||||
@@ -113,9 +113,9 @@
|
||||
this.lbResults.TabIndex = 31;
|
||||
this.lbResults.Text = "Baseline";
|
||||
this.lbResults.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
//
|
||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.optionsToolStripMenuItem});
|
||||
@@ -125,32 +125,32 @@
|
||||
this.menuStrip1.Size = new System.Drawing.Size(815, 24);
|
||||
this.menuStrip1.TabIndex = 32;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
//
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.configurationToolStripMenuItem,
|
||||
this.exitToolStripMenuItem});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 22);
|
||||
this.optionsToolStripMenuItem.Text = "Options";
|
||||
//
|
||||
//
|
||||
// configurationToolStripMenuItem
|
||||
//
|
||||
//
|
||||
this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
|
||||
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.configurationToolStripMenuItem.Text = "Configuration";
|
||||
this.configurationToolStripMenuItem.Click += new System.EventHandler(this.configurationToolStripMenuItem_Click);
|
||||
//
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.exitToolStripMenuItem.Text = "Exit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
//
|
||||
// ErrorMessages
|
||||
//
|
||||
//
|
||||
this.ErrorMessages.Location = new System.Drawing.Point(846, 79);
|
||||
this.ErrorMessages.Multiline = true;
|
||||
this.ErrorMessages.Name = "ErrorMessages";
|
||||
@@ -159,9 +159,9 @@
|
||||
this.ErrorMessages.Size = new System.Drawing.Size(360, 272);
|
||||
this.ErrorMessages.TabIndex = 5;
|
||||
this.ErrorMessages.TabStop = false;
|
||||
//
|
||||
//
|
||||
// chtTPS
|
||||
//
|
||||
//
|
||||
this.chtTPS.BackColor = System.Drawing.Color.Transparent;
|
||||
chartArea1.AxisX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Seconds;
|
||||
chartArea1.AxisX.MajorGrid.Enabled = false;
|
||||
@@ -194,9 +194,9 @@
|
||||
this.chtTPS.Size = new System.Drawing.Size(348, 268);
|
||||
this.chtTPS.TabIndex = 33;
|
||||
this.chtTPS.Text = "chart1";
|
||||
//
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
//
|
||||
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1,
|
||||
@@ -208,40 +208,40 @@
|
||||
this.statusStrip1.Size = new System.Drawing.Size(815, 22);
|
||||
this.statusStrip1.TabIndex = 35;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
//
|
||||
// toolStripStatusLabel1
|
||||
//
|
||||
//
|
||||
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
||||
this.toolStripStatusLabel1.Size = new System.Drawing.Size(80, 17);
|
||||
this.toolStripStatusLabel1.Text = "Elapsed Time:";
|
||||
//
|
||||
//
|
||||
// lblTime
|
||||
//
|
||||
//
|
||||
this.lblTime.Name = "lblTime";
|
||||
this.lblTime.Size = new System.Drawing.Size(13, 17);
|
||||
this.lblTime.Text = "0";
|
||||
//
|
||||
//
|
||||
// toolStripStatusLabel3
|
||||
//
|
||||
//
|
||||
this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
|
||||
this.toolStripStatusLabel3.Size = new System.Drawing.Size(100, 17);
|
||||
this.toolStripStatusLabel3.Text = "Running Threads:";
|
||||
//
|
||||
//
|
||||
// lblThreads
|
||||
//
|
||||
//
|
||||
this.lblThreads.Name = "lblThreads";
|
||||
this.lblThreads.Size = new System.Drawing.Size(13, 17);
|
||||
this.lblThreads.Text = "0";
|
||||
//
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
//
|
||||
this.splitContainer1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
//
|
||||
this.splitContainer1.Panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.splitContainer1.Panel1.Controls.Add(this.label4);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.speedDialPanel);
|
||||
@@ -252,17 +252,17 @@
|
||||
this.splitContainer1.Panel1.Controls.Add(this.btnRun);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.btnStop);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.lbResults);
|
||||
//
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.chtLatches);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.chtCPU);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(786, 655);
|
||||
this.splitContainer1.SplitterDistance = 398;
|
||||
this.splitContainer1.TabIndex = 39;
|
||||
//
|
||||
//
|
||||
// label4
|
||||
//
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
@@ -272,17 +272,17 @@
|
||||
this.label4.Size = new System.Drawing.Size(122, 13);
|
||||
this.label4.TabIndex = 45;
|
||||
this.label4.Text = "Transactions/sec x1000";
|
||||
//
|
||||
//
|
||||
// speedDialPanel
|
||||
//
|
||||
//
|
||||
this.speedDialPanel.Location = new System.Drawing.Point(21, 86);
|
||||
this.speedDialPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.speedDialPanel.Name = "speedDialPanel";
|
||||
this.speedDialPanel.Size = new System.Drawing.Size(319, 260);
|
||||
this.speedDialPanel.TabIndex = 43;
|
||||
//
|
||||
//
|
||||
// label2
|
||||
//
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
@@ -292,9 +292,9 @@
|
||||
this.label2.Size = new System.Drawing.Size(124, 17);
|
||||
this.label2.TabIndex = 42;
|
||||
this.label2.Text = "Transactions / sec";
|
||||
//
|
||||
//
|
||||
// label1
|
||||
//
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
@@ -303,9 +303,9 @@
|
||||
this.label1.Size = new System.Drawing.Size(260, 17);
|
||||
this.label1.TabIndex = 41;
|
||||
this.label1.Text = "Increase in performance since last reset";
|
||||
//
|
||||
//
|
||||
// btnToggle
|
||||
//
|
||||
//
|
||||
this.btnToggle.BackColor = System.Drawing.Color.White;
|
||||
this.btnToggle.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnToggle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
@@ -317,9 +317,9 @@
|
||||
this.btnToggle.Text = "Show diagnostics ";
|
||||
this.btnToggle.UseVisualStyleBackColor = false;
|
||||
this.btnToggle.Click += new System.EventHandler(this.btnToggle_Click);
|
||||
//
|
||||
//
|
||||
// chtLatches
|
||||
//
|
||||
//
|
||||
chartArea2.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
|
||||
chartArea2.AxisX.LabelStyle.Enabled = false;
|
||||
chartArea2.AxisX.LineColor = System.Drawing.Color.White;
|
||||
@@ -349,9 +349,9 @@
|
||||
this.chtLatches.Size = new System.Drawing.Size(685, 84);
|
||||
this.chtLatches.TabIndex = 42;
|
||||
this.chtLatches.Text = "chart1";
|
||||
//
|
||||
//
|
||||
// chtCPU
|
||||
//
|
||||
//
|
||||
this.chtCPU.BackColor = System.Drawing.Color.Transparent;
|
||||
chartArea3.AxisX.LabelStyle.Enabled = false;
|
||||
chartArea3.AxisX.LineColor = System.Drawing.Color.White;
|
||||
@@ -386,9 +386,9 @@
|
||||
this.chtCPU.Series.Add(series3);
|
||||
this.chtCPU.Size = new System.Drawing.Size(786, 253);
|
||||
this.chtCPU.TabIndex = 41;
|
||||
//
|
||||
//
|
||||
// label3
|
||||
//
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label3.Location = new System.Drawing.Point(843, 40);
|
||||
@@ -396,9 +396,9 @@
|
||||
this.label3.Size = new System.Drawing.Size(83, 13);
|
||||
this.label3.TabIndex = 11;
|
||||
this.label3.Text = "Error Messages:";
|
||||
//
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
|
||||
+52
-52
@@ -1,15 +1,15 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,13 +22,13 @@ using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
using System.Windows.Forms.Integration;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Documentation References:
|
||||
/// <summary>
|
||||
///
|
||||
/// Documentation References:
|
||||
/// In-Memory OLTP (In-Memory Optimization): https://msdn.microsoft.com/en-us/library/dn133186.aspx
|
||||
/// OLTP and database management: https://www.microsoft.com/en-us/server-cloud/solutions/oltp-database-management.aspx
|
||||
/// </summary>
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
namespace DemoWorkload
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace DemoWorkload
|
||||
delegate void SetTextCallback(string text);
|
||||
|
||||
public Object ErrorLock = new Object();
|
||||
public Object StopLock = new Object();
|
||||
public Object StopLock = new Object();
|
||||
|
||||
List<Thread> RunningThreads = new List<Thread>();
|
||||
Thread MonitorThread;
|
||||
@@ -55,13 +55,13 @@ namespace DemoWorkload
|
||||
InitializeComponent();
|
||||
uiControls.speedDial.MaxValue = Program.MAX_TPS;
|
||||
}
|
||||
|
||||
|
||||
delegate void SetInt64Callback(Int64 value);
|
||||
delegate void SetIntCallback(int value);
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Adds a line of text into the message box
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void AddText(string text)
|
||||
{
|
||||
// InvokeRequired required compares the thread ID of the
|
||||
@@ -78,31 +78,31 @@ namespace DemoWorkload
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Updates the thread count display
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateCount(string TC)
|
||||
{
|
||||
try { this.lblThreads.Text = TC.ToString(); }
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("UpdateCount", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Updates the elapsed time display
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateElapsed(string Elapsed)
|
||||
{
|
||||
this.lblTime.Text = Elapsed.ToString();
|
||||
this.lblTime.Text = Elapsed.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the CPU% bar in the chart
|
||||
/// <summary>
|
||||
/// Updates the CPU% bar in the chart
|
||||
/// Note that this proc does NOT cause the chart to refresh.
|
||||
/// that is done in UpdateTPS(), which should be called after this proc.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateCPUChart(int CPU)
|
||||
{
|
||||
try {
|
||||
try {
|
||||
if (this.statusStrip1.InvokeRequired)
|
||||
{
|
||||
SetIntCallback d = new SetIntCallback(UpdateCPUChart);
|
||||
@@ -119,12 +119,12 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("UpdateCPUChart", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Updates Latches in the Chart
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateLatchChart(Int64 Latches)
|
||||
{
|
||||
try {
|
||||
try {
|
||||
if (this.statusStrip1.InvokeRequired)
|
||||
{
|
||||
SetInt64Callback d = new SetInt64Callback(UpdateLatchChart);
|
||||
@@ -141,12 +141,12 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("UpdateLatchChart", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Updates the TPS bar in the chart, and causes the whole chart to be re-drawn with the new data.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateTPSChart(Int64 TPS)
|
||||
{
|
||||
try {
|
||||
try {
|
||||
if (this.statusStrip1.InvokeRequired)
|
||||
{
|
||||
SetInt64Callback d = new SetInt64Callback(UpdateTPSChart);
|
||||
@@ -157,9 +157,9 @@ namespace DemoWorkload
|
||||
// Updating Speedometer
|
||||
if (TPS >= 0)
|
||||
{
|
||||
double normalizedTPS = (double)TPS / 1000;
|
||||
double normalizedTPS = (double)TPS / 1000;
|
||||
uiControls.speedDial.CurrentValue = normalizedTPS;
|
||||
uiControls.speedDial.DialText = normalizedTPS.ToString("#.##");
|
||||
uiControls.speedDial.DialText = normalizedTPS.ToString("#.##");
|
||||
|
||||
// Updating TPS chart
|
||||
TPSChartTime++;
|
||||
@@ -183,9 +183,9 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("UpdateTPSChart", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Updates Results
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private void UpdateResults(string Results)
|
||||
{
|
||||
try
|
||||
@@ -211,9 +211,9 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("UpdateResults", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Executes Write/Read Commands
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
void OnRunClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
@@ -246,7 +246,7 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("OnRunClick", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Executes Transactions on the target server
|
||||
/// </summary>
|
||||
void ThreadWorker(object tp)
|
||||
@@ -307,7 +307,7 @@ namespace DemoWorkload
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Thread Monitor
|
||||
/// </summary>
|
||||
void ThreadMonitor()
|
||||
@@ -455,7 +455,7 @@ namespace DemoWorkload
|
||||
UpdateTPSChart(TPS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Stop Button
|
||||
/// </summary>
|
||||
private void btnStop_Click(object sender, EventArgs e)
|
||||
@@ -465,7 +465,7 @@ namespace DemoWorkload
|
||||
Stopped = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Application Exit
|
||||
/// </summary>
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -473,7 +473,7 @@ namespace DemoWorkload
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Configuratino Settings
|
||||
/// </summary>
|
||||
private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -487,7 +487,7 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("configurationToolStripMenuItem_Click", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Show Diagnostics
|
||||
/// </summary>
|
||||
private void btnToggle_Click(object sender, EventArgs e)
|
||||
@@ -509,7 +509,7 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("btnToggle_Click", ex); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Frm Main Load
|
||||
/// </summary>
|
||||
private void FrmMain_Load(object sender, EventArgs e)
|
||||
@@ -529,7 +529,7 @@ namespace DemoWorkload
|
||||
catch (Exception ex) { ShowThreadExceptionDialog("FrmMain_Load", ex);}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Frm Main Closing
|
||||
/// </summary>
|
||||
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
@@ -545,7 +545,7 @@ namespace DemoWorkload
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Creates an error message and displays it.
|
||||
/// </summary>
|
||||
private static DialogResult ShowThreadExceptionDialog(string title, Exception e)
|
||||
@@ -558,7 +558,7 @@ namespace DemoWorkload
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// ThreadParams Class
|
||||
/// </summary>
|
||||
class ThreadParams
|
||||
|
||||
+27
-27
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@ using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DemoWorkload")]
|
||||
@@ -15,8 +15,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -26,11 +26,11 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
|
||||
+10
-10
@@ -10,8 +10,8 @@
|
||||
|
||||
namespace DemoWorkload.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
@@ -23,15 +23,15 @@ namespace DemoWorkload.Properties {
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
@@ -45,7 +45,7 @@ namespace DemoWorkload.Properties {
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
@@ -59,7 +59,7 @@ namespace DemoWorkload.Properties {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -69,7 +69,7 @@ namespace DemoWorkload.Properties {
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -79,7 +79,7 @@ namespace DemoWorkload.Properties {
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
|
||||
+27
-27
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
+4
-4
@@ -9,14 +9,14 @@
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DemoWorkload.Properties {
|
||||
|
||||
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
|
||||
+13
-13
@@ -1,15 +1,15 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
|
||||
using Gauge = CircularGauge.CircularGaugeControl;
|
||||
using MediaColor = System.Windows.Media.Color;
|
||||
@@ -39,7 +39,7 @@ namespace DemoWorkload
|
||||
_speedDial.PointerCapRadius = 0;
|
||||
_speedDial.MinValue = 0;
|
||||
_speedDial.MaxValue = 60;
|
||||
_speedDial.DialText = "0";
|
||||
_speedDial.DialText = "0";
|
||||
_speedDial.MajorDivisionsCount = 10;
|
||||
_speedDial.MinorDivisionsCount = 5;
|
||||
_speedDial.RangeIndicatorThickness = 0;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
-- helper stored procedure to batch reservations
|
||||
-- helper stored procedure to batch reservations
|
||||
|
||||
CREATE PROCEDURE BatchInsertReservations(@ServerTransactions int, @RowsPerTransaction int, @ThreadID int)
|
||||
AS
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ BEGIN
|
||||
DECLARE @loop int = 0;
|
||||
WHILE (@loop < @LineCount)
|
||||
BEGIN
|
||||
INSERT INTO dbo.TicketReservationDetail (TicketReservationID, Quantity, FlightID, Comment)
|
||||
INSERT INTO dbo.TicketReservationDetail (TicketReservationID, Quantity, FlightID, Comment)
|
||||
VALUES(@TicketReservationID, @loop % 8 + 1, @FlightID, @Comment);
|
||||
SET @loop += 1;
|
||||
END
|
||||
@@ -24,7 +24,7 @@ BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL=SNAPSHOT, LANGUAGE=N'English')
|
||||
DECLARE @loop int = 0;
|
||||
while (@loop < @LineCount)
|
||||
BEGIN
|
||||
INSERT INTO dbo.TicketReservationDetail (TicketReservationID, Quantity, FlightID, Comment)
|
||||
INSERT INTO dbo.TicketReservationDetail (TicketReservationID, Quantity, FlightID, Comment)
|
||||
VALUES(@TicketReservationID, @loop % 8 + 1, @FlightID, @Comment);
|
||||
SET @loop += 1;
|
||||
END
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
CREATE PROCEDURE ReadMultipleReservations(@ServerTransactions int, @RowsPerTransaction int, @ThreadID int)
|
||||
AS
|
||||
BEGIN
|
||||
BEGIN
|
||||
DECLARE @tranCount int = 0;
|
||||
DECLARE @CurrentSeq int = 0;
|
||||
DECLARE @Sum int = 0;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<add key="sqlOndiskSPName" value="OnDisk.InsertCustomerOrders"/> <!--On disk Stored Procedure Name-->
|
||||
<add key="sqlInMemorySPName" value="InMemory.InsertCustomerOrders"/> <!--In Memory Stored Procedure Name-->
|
||||
<add key="sqlInMemoryWithCCISPName" value="InMemory.InsertCustomerOrders_CCI"/> <!--In Memory Stored Procedure Name With ColumnStore Index-->
|
||||
<add key="sqlInMemorySPName" value="InMemory.InsertCustomerOrders"/> <!--In Memory Stored Procedure Name-->
|
||||
<add key="sqlInMemoryWithCCISPName" value="InMemory.InsertCustomerOrders_CCI"/> <!--In Memory Stored Procedure Name With ColumnStore Index-->
|
||||
<add key="numberOfTasks" value="250"/> <!--Number of concurrent async tasks that the Data Generator will use-->
|
||||
<add key="batchSize" value="200"/> <!--Row Batch Size that every task produces-->
|
||||
<add key="commandDelay" value="0"/> <!--Delay between sql commands. You can set this to 0 for max high volume workload-->
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DataGenerator")]
|
||||
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -25,11 +25,11 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
|
||||
+26
-26
@@ -1,15 +1,15 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
//----------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//----------------------------------------------------------------------------------
|
||||
// The example companies, organizations, products, domain names,
|
||||
// e-mail addresses, logos, people, places, and events depicted
|
||||
// herein are fictitious. No association with any real company,
|
||||
// organization, product, domain name, email address, logo, person,
|
||||
// places, or events is intended or should be inferred.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -83,19 +83,19 @@ namespace DataGenerator
|
||||
|
||||
/// <summary>Creates a new instance of the SqlDataGenerator Class.</summary>
|
||||
/// <param name="sqlConnectionString">The sqlserver connectionString. Example: "Data Source=.;Initial Catalog=DbName;Integrated Security=True"</param>
|
||||
/// <param name="sqlInsertSPName">The Insert Orders sqlserver stored procedure. Example: "InsertOrdersSP". </param>
|
||||
/// <param name="sqlInsertSPName">The Insert Orders sqlserver stored procedure. Example: "InsertOrdersSP". </param>
|
||||
/// <param name="sqlCommandTimeout">The sqlserver command timeout. Example: 600</param>
|
||||
/// <param name="initialNumberOfTasks">The number of concurrent tasks. Example: 5. Note that every task 1.Creates and opens a new sql connection 2.Creates sample data and 3.Executes the sql stored procedure passed in sqlStoredProcedureName endless times until stopped by the user.</param>
|
||||
/// <param name="delayInMilliseconds">Delay in Millisecods betweeen Sql Commands. Example. 100</param>
|
||||
/// <param name="batchSize">The row count of the batch size to be used by every task. Example: 200</param>
|
||||
/// <param name="onException">Exception call back method with TaskId(int) and exception(Exception). Example: ExceptionCallback</param>
|
||||
public SqlDataGenerator(
|
||||
string sqlConnectionString,
|
||||
string sqlConnectionString,
|
||||
string sqlInsertSPName,
|
||||
int sqlCommandTimeout,
|
||||
int initialNumberOfTasks,
|
||||
int delayInMilliseconds,
|
||||
int batchSize,
|
||||
int sqlCommandTimeout,
|
||||
int initialNumberOfTasks,
|
||||
int delayInMilliseconds,
|
||||
int batchSize,
|
||||
Action<int, Exception> onException)
|
||||
{
|
||||
|
||||
@@ -108,13 +108,13 @@ namespace DataGenerator
|
||||
this.initialNumberOfTasks = initialNumberOfTasks;
|
||||
this.delay = delayInMilliseconds;
|
||||
this.batchSize = batchSize;
|
||||
|
||||
|
||||
Validate(this.batchSize, this.initialNumberOfTasks, this.delay);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Creates and Starts all the tasks asynchronously. Note that every task 1.Creates and opens a new sql connection 2.Creates a batch of BatchSize sample data and 3.Executes the sql stored procedure passed in sqlStoredProcedureName endless times until stopped by the user.</summary>
|
||||
/// <returns>Task</returns>
|
||||
/// <returns>Task</returns>
|
||||
public async Task RunAsync()
|
||||
{
|
||||
if (this.running)
|
||||
@@ -184,7 +184,7 @@ namespace DataGenerator
|
||||
await connection.OpenAsync(token);
|
||||
|
||||
using (var insertCommand = connection.CreateCommand())
|
||||
{
|
||||
{
|
||||
insertCommand.CommandType = CommandType.StoredProcedure;
|
||||
insertCommand.CommandTimeout = this.sqlCommandTimeout;
|
||||
insertCommand.CommandText = this.sqlInsertSPName;
|
||||
@@ -192,7 +192,7 @@ namespace DataGenerator
|
||||
insertCommand.Parameters.Add("@OrderLines", SqlDbType.Structured);
|
||||
insertCommand.Parameters.Add("@OrdersCreatedByPersonID", SqlDbType.Int);
|
||||
insertCommand.Parameters.Add("@SalespersonPersonID", SqlDbType.Int);
|
||||
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
using (var selectCommand = connection.CreateCommand())
|
||||
@@ -235,7 +235,7 @@ namespace DataGenerator
|
||||
{
|
||||
// TODO: Lock
|
||||
if (numberOfTasksToStop >= this.RunningTasks) { this.running = false; }
|
||||
|
||||
|
||||
numberOfTasksToStop = Math.Min(numberOfTasksToStop, this.RunningTasks);
|
||||
List<CancellableTask> cancellableTasksToKill = this.tasks.Take(numberOfTasksToStop).Select(kv => kv.Value).ToList();
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace DataGenerator
|
||||
/// <returns>Task</returns>
|
||||
/// <param name="numberOfTasks">The number of Tasks to start/stop depending of the number of tasks currently running.</param>
|
||||
private async Task RunAsync(int numberOfTasks)
|
||||
{
|
||||
{
|
||||
for (int i = 0; i < numberOfTasks; i++)
|
||||
{
|
||||
CancellationTokenSource tokenSource = new CancellationTokenSource();
|
||||
@@ -264,7 +264,7 @@ namespace DataGenerator
|
||||
|
||||
tasks.TryAdd(taskId, new CancellableTask(taskId, task, tokenSource));
|
||||
}
|
||||
|
||||
|
||||
this.running = true;
|
||||
|
||||
await Task.WhenAll(this.tasks.Values.Select(t => t.Task));
|
||||
@@ -305,7 +305,7 @@ namespace DataGenerator
|
||||
{
|
||||
throw new SqlDataGeneratorException("Delay cannot be less than zero");
|
||||
}
|
||||
|
||||
|
||||
// Reset Rps
|
||||
RpsReset();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ To run this sample, you need the following prerequisites.
|
||||
|
||||
5. Build the app and run it. Do not use the debugger, as that will slow down the app.
|
||||
|
||||
6. You can see the performance gains by switching to the In-Memory radio button option.
|
||||
6. You can see the performance gains by switching to the In-Memory radio button option.
|
||||
|
||||
<a name=sample-details></a>
|
||||
|
||||
|
||||
+34
-34
@@ -53,9 +53,9 @@
|
||||
this.bottomToolStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.RpsChart)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
//
|
||||
// bottomToolStrip
|
||||
//
|
||||
//
|
||||
this.bottomToolStrip.BackColor = System.Drawing.Color.White;
|
||||
this.bottomToolStrip.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.bottomToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -72,61 +72,61 @@
|
||||
this.bottomToolStrip.Size = new System.Drawing.Size(851, 43);
|
||||
this.bottomToolStrip.TabIndex = 0;
|
||||
this.bottomToolStrip.Text = "toolStrip1";
|
||||
//
|
||||
//
|
||||
// lblTasksTitle
|
||||
//
|
||||
//
|
||||
this.lblTasksTitle.ForeColor = System.Drawing.Color.Gray;
|
||||
this.lblTasksTitle.Name = "lblTasksTitle";
|
||||
this.lblTasksTitle.Size = new System.Drawing.Size(52, 40);
|
||||
this.lblTasksTitle.Text = "Threads:";
|
||||
//
|
||||
//
|
||||
// lblTasksValue
|
||||
//
|
||||
//
|
||||
this.lblTasksValue.Name = "lblTasksValue";
|
||||
this.lblTasksValue.Size = new System.Drawing.Size(13, 40);
|
||||
this.lblTasksValue.Text = "0";
|
||||
//
|
||||
//
|
||||
// tss_1
|
||||
//
|
||||
//
|
||||
this.tss_1.Name = "tss_1";
|
||||
this.tss_1.Size = new System.Drawing.Size(6, 43);
|
||||
//
|
||||
//
|
||||
// lblBatchSizeTitle
|
||||
//
|
||||
//
|
||||
this.lblBatchSizeTitle.ForeColor = System.Drawing.Color.Gray;
|
||||
this.lblBatchSizeTitle.Name = "lblBatchSizeTitle";
|
||||
this.lblBatchSizeTitle.Size = new System.Drawing.Size(98, 40);
|
||||
this.lblBatchSizeTitle.Text = "Rows Per Thread:";
|
||||
//
|
||||
//
|
||||
// lblBatchSizeValue
|
||||
//
|
||||
//
|
||||
this.lblBatchSizeValue.Name = "lblBatchSizeValue";
|
||||
this.lblBatchSizeValue.Size = new System.Drawing.Size(13, 40);
|
||||
this.lblBatchSizeValue.Text = "0";
|
||||
//
|
||||
//
|
||||
// tss_2
|
||||
//
|
||||
//
|
||||
this.tss_2.Name = "tss_2";
|
||||
this.tss_2.Size = new System.Drawing.Size(6, 43);
|
||||
//
|
||||
//
|
||||
// lblRpsTitle
|
||||
//
|
||||
//
|
||||
this.lblRpsTitle.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.lblRpsTitle.ForeColor = System.Drawing.Color.DimGray;
|
||||
this.lblRpsTitle.Name = "lblRpsTitle";
|
||||
this.lblRpsTitle.Size = new System.Drawing.Size(112, 40);
|
||||
this.lblRpsTitle.Text = "Rows/sec inserted:";
|
||||
//
|
||||
//
|
||||
// lblRpsValue
|
||||
//
|
||||
//
|
||||
this.lblRpsValue.Font = new System.Drawing.Font("Segoe UI", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblRpsValue.ForeColor = System.Drawing.Color.Red;
|
||||
this.lblRpsValue.Name = "lblRpsValue";
|
||||
this.lblRpsValue.Size = new System.Drawing.Size(33, 40);
|
||||
this.lblRpsValue.Text = "0";
|
||||
//
|
||||
//
|
||||
// Start
|
||||
//
|
||||
//
|
||||
this.Start.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
|
||||
this.Start.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.Start.Location = new System.Drawing.Point(717, 291);
|
||||
@@ -136,9 +136,9 @@
|
||||
this.Start.Text = "Start";
|
||||
this.Start.UseVisualStyleBackColor = true;
|
||||
this.Start.Click += new System.EventHandler(this.Start_Click);
|
||||
//
|
||||
//
|
||||
// Stop
|
||||
//
|
||||
//
|
||||
this.Stop.Enabled = false;
|
||||
this.Stop.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
|
||||
this.Stop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
@@ -149,9 +149,9 @@
|
||||
this.Stop.Text = "Stop";
|
||||
this.Stop.UseVisualStyleBackColor = true;
|
||||
this.Stop.Click += new System.EventHandler(this.Stop_Click);
|
||||
//
|
||||
//
|
||||
// RpsChart
|
||||
//
|
||||
//
|
||||
this.RpsChart.BackColor = System.Drawing.Color.Transparent;
|
||||
this.RpsChart.BorderlineColor = System.Drawing.Color.Black;
|
||||
chartArea1.AxisX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Seconds;
|
||||
@@ -192,14 +192,14 @@
|
||||
this.RpsChart.Size = new System.Drawing.Size(847, 262);
|
||||
this.RpsChart.TabIndex = 102;
|
||||
this.RpsChart.Text = "Rows / Sec";
|
||||
//
|
||||
//
|
||||
// rpsTimer
|
||||
//
|
||||
//
|
||||
this.rpsTimer.Interval = 300;
|
||||
this.rpsTimer.Tick += new System.EventHandler(this.rpsTimer_Tick);
|
||||
//
|
||||
//
|
||||
// InMemoryRadioButton
|
||||
//
|
||||
//
|
||||
this.InMemoryRadioButton.AutoSize = true;
|
||||
this.InMemoryRadioButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.InMemoryRadioButton.Location = new System.Drawing.Point(553, 258);
|
||||
@@ -208,9 +208,9 @@
|
||||
this.InMemoryRadioButton.TabIndex = 105;
|
||||
this.InMemoryRadioButton.Text = "In Memory";
|
||||
this.InMemoryRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//
|
||||
// OnDiskRadioButton
|
||||
//
|
||||
//
|
||||
this.OnDiskRadioButton.AutoSize = true;
|
||||
this.OnDiskRadioButton.Checked = true;
|
||||
this.OnDiskRadioButton.Location = new System.Drawing.Point(484, 258);
|
||||
@@ -220,9 +220,9 @@
|
||||
this.OnDiskRadioButton.TabStop = true;
|
||||
this.OnDiskRadioButton.Text = "On Disk";
|
||||
this.OnDiskRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//
|
||||
// InMemoryWithCSIRadioButton
|
||||
//
|
||||
//
|
||||
this.InMemoryWithCSIRadioButton.AutoSize = true;
|
||||
this.InMemoryWithCSIRadioButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.InMemoryWithCSIRadioButton.Location = new System.Drawing.Point(633, 258);
|
||||
@@ -231,9 +231,9 @@
|
||||
this.InMemoryWithCSIRadioButton.TabIndex = 106;
|
||||
this.InMemoryWithCSIRadioButton.Text = "In Memory With ColumnStore Index";
|
||||
this.InMemoryWithCSIRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
|
||||
+21
-21
@@ -1,15 +1,15 @@
|
||||
/*----------------------------------------------------------------------------------
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
----------------------------------------------------------------------------------
|
||||
The example companies, organizations, products, domain names,
|
||||
e-mail addresses, logos, people, places, and events depicted
|
||||
herein are fictitious. No association with any real company,
|
||||
organization, product, domain name, email address, logo, person,
|
||||
places, or events is intended or should be inferred.
|
||||
/*----------------------------------------------------------------------------------
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
----------------------------------------------------------------------------------
|
||||
The example companies, organizations, products, domain names,
|
||||
e-mail addresses, logos, people, places, and events depicted
|
||||
herein are fictitious. No association with any real company,
|
||||
organization, product, domain name, email address, logo, person,
|
||||
places, or events is intended or should be inferred.
|
||||
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Client
|
||||
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ExceptionCallback(int taskId, Exception exception)
|
||||
@@ -50,13 +50,13 @@ namespace Client
|
||||
{
|
||||
// Uncomment for debugging
|
||||
string ex = taskId?.ToString() + " - " + exception.Message + (exception.InnerException != null ? "\n\nInner Exception\n" + exception.InnerException : "");
|
||||
using (StreamWriter w = File.AppendText(logFileName)) { w.WriteLine("\r\n{0}: {1}", DateTime.Now, ex); }
|
||||
using (StreamWriter w = File.AppendText(logFileName)) { w.WriteLine("\r\n{0}: {1}", DateTime.Now, ex); }
|
||||
}
|
||||
|
||||
private async void Start_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
this.rpsTimer.Start();
|
||||
this.Stop.Enabled = true;
|
||||
this.Stop.Update();
|
||||
@@ -77,7 +77,7 @@ namespace Client
|
||||
private async void Stop_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
//this.UpdateChart(-1);
|
||||
this.rpsTimer.Stop();
|
||||
//this.lblRpsValue.Text = "0";
|
||||
@@ -97,7 +97,7 @@ namespace Client
|
||||
}
|
||||
|
||||
private void UpdateChart(double rps)
|
||||
{
|
||||
{
|
||||
if (rps >= 0)
|
||||
{
|
||||
rpsChartTime++;
|
||||
@@ -136,7 +136,7 @@ namespace Client
|
||||
{
|
||||
this.spName = ConfigurationManager.AppSettings["sqlInMemoryWithCCISPName"];
|
||||
}
|
||||
|
||||
|
||||
this.logFileName = ConfigurationManager.AppSettings["logFileName"];
|
||||
this.tasks = int.Parse(ConfigurationManager.AppSettings["numberOfTasks"]);
|
||||
this.batchSize = int.Parse(ConfigurationManager.AppSettings["batchSize"]);
|
||||
@@ -146,7 +146,7 @@ namespace Client
|
||||
|
||||
this.dataGenerator = new SqlDataGenerator(this.connection, this.spName, this.commandTimeout, this.tasks, this.delay, this.batchSize, this.ExceptionCallback);
|
||||
|
||||
// Initialize Timers
|
||||
// Initialize Timers
|
||||
this.rpsTimer.Interval = this.rpsFrequency;
|
||||
|
||||
// Initialize Labels
|
||||
@@ -159,7 +159,7 @@ namespace Client
|
||||
|
||||
if (delay < 0) throw new SqlDataGeneratorException("Delay cannot be less than zero");
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception exception) { HandleException(exception); }
|
||||
}
|
||||
@@ -174,7 +174,7 @@ namespace Client
|
||||
if (dataGenerator.IsRunning)
|
||||
{
|
||||
if (this.dataGenerator.RunningTasks == 0) return;
|
||||
|
||||
|
||||
if (rps > 0)
|
||||
{
|
||||
this.lblRpsValue.Text = string.Format("{0:#,#}", rps).ToString();
|
||||
|
||||
+27
-27
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Client")]
|
||||
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -25,11 +25,11 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
|
||||
+7
-7
@@ -10,8 +10,8 @@
|
||||
|
||||
namespace Client.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
@@ -23,15 +23,15 @@ namespace Client.Properties {
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
@@ -45,7 +45,7 @@ namespace Client.Properties {
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
|
||||
+27
-27
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
||||
BIN
Binary file not shown.
+3
-3
@@ -1,8 +1,8 @@
|
||||
-- SQL 2019
|
||||
|
||||
-- Restore AdventureWorks
|
||||
RESTORE DATABASE [AdventureWorks]
|
||||
FROM DISK = N'F:\MSSQL\MSSQL15.SQL2019\MSSQL\Backup\AdventureWorks2016_EXT.bak'
|
||||
RESTORE DATABASE [AdventureWorks]
|
||||
FROM DISK = N'F:\MSSQL\MSSQL15.SQL2019\MSSQL\Backup\AdventureWorks2016_EXT.bak'
|
||||
WITH FILE = 1
|
||||
, MOVE N'AdventureWorks2016_EXT_Data' TO N'F:\MSSQL\MSSQL15.SQL2019\MSSQL\DATA\AdventureWorks_Data.mdf'
|
||||
, MOVE N'AdventureWorks2016_EXT_Log' TO N'F:\MSSQL\MSSQL15.SQL2019\MSSQL\DATA\AdventureWorks_Log.ldf'
|
||||
@@ -20,5 +20,5 @@ GO
|
||||
|
||||
-- Upgrade compatibility
|
||||
ALTER DATABASE AdventureWorks
|
||||
SET COMPATIBILITY_LEVEL = 150;
|
||||
SET COMPATIBILITY_LEVEL = 150;
|
||||
GO
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ BEGIN
|
||||
|
||||
INSERT #Birthdays (BusinessEntityID)
|
||||
SELECT BusinessEntityID
|
||||
FROM HumanResources.Employee
|
||||
FROM HumanResources.Employee
|
||||
WHERE MONTH(BirthDate) = @month
|
||||
|
||||
SELECT p.FirstName, p.LastName, a.AddressLine1, a.AddressLine2, a.City, sp.StateProvinceCode, a.PostalCode
|
||||
|
||||
+10
-10
@@ -2,20 +2,20 @@
|
||||
-- NEW FUNCTIONS AVAILABLE IN SQL SERVER 2019
|
||||
USE master
|
||||
GO
|
||||
SELECT
|
||||
er.session_id, er.wait_type, er.wait_resource,
|
||||
SELECT
|
||||
er.session_id, er.wait_type, er.wait_resource,
|
||||
OBJECT_NAME(page_info.[object_id],page_info.database_id) as [object_name],
|
||||
er.blocking_session_id,er.command,
|
||||
SUBSTRING(st.text, (er.statement_start_offset/2)+1,
|
||||
((CASE er.statement_end_offset
|
||||
WHEN -1 THEN DATALENGTH(st.text)
|
||||
ELSE er.statement_end_offset
|
||||
er.blocking_session_id,er.command,
|
||||
SUBSTRING(st.text, (er.statement_start_offset/2)+1,
|
||||
((CASE er.statement_end_offset
|
||||
WHEN -1 THEN DATALENGTH(st.text)
|
||||
ELSE er.statement_end_offset
|
||||
END - er.statement_start_offset)/2) + 1) AS statement_text,
|
||||
page_info.database_id,page_info.[file_id], page_info.page_id, page_info.[object_id],
|
||||
page_info.database_id,page_info.[file_id], page_info.page_id, page_info.[object_id],
|
||||
page_info.index_id, page_info.page_type_desc
|
||||
FROM sys.dm_exec_requests AS er
|
||||
CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) AS st
|
||||
CROSS APPLY sys.fn_PageResCracker (er.page_resource) AS r
|
||||
CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) AS st
|
||||
CROSS APPLY sys.fn_PageResCracker (er.page_resource) AS r
|
||||
CROSS APPLY sys.dm_db_page_info(r.[db_id], r.[file_id], r.page_id, 'DETAILED') AS page_info
|
||||
WHERE er.wait_type like '%page%'
|
||||
GO
|
||||
Reference in New Issue
Block a user