Skip to content

Commit

Permalink
1.5.0 Tests for the SQL Server 2012
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoNeugebauer committed Sep 3, 2017
1 parent fac4e79 commit 781718c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 17 deletions.
11 changes: 6 additions & 5 deletions Tests/SQL-2012/Alignment_test1RowTable.sql
Expand Up @@ -34,7 +34,8 @@ BEGIN
ColumnId int,
ColumnName nvarchar(256),
ColumnType nvarchar(256),
SegmentElimination varchar(50),
SegmentElimination varchar(25) NOT NULL,
PredicatePushdown varchar(25) NOT NULL,
DealignedSegments int,
TotalSegments int,
SegmentAlignment Decimal(8,2)
Expand All @@ -55,9 +56,9 @@ BEGIN
-- NCI on HEAP
-- Insert expected result
insert into #ExpectedAlignment
(TableName, Location, Partition, [ColumnId], ColumnName, ColumnType, [SegmentElimination], [DealignedSegments], [TotalSegments], SegmentAlignment)
(TableName, Location, Partition, [ColumnId], ColumnName, ColumnType, [SegmentElimination], [PredicatePushdown], [DealignedSegments], [TotalSegments], SegmentAlignment)
values
('[dbo].[OneRowNCI_Heap]', 'Disk-Based', 1, 1, 'c1', 'int', 'OK', 0, 1, 100.00 );
('[dbo].[OneRowNCI_Heap]', 'Disk-Based', 1, 1, 'c1', 'int', 'OK', 'OK', 0, 1, 100.00 );

insert into #ActualAlignment
exec dbo.cstore_GetAlignment @tableName = 'OneRowNCI_Heap';
Expand All @@ -70,9 +71,9 @@ BEGIN
-- NCI on Clustered
-- Insert expected result
insert into #ExpectedAlignment
(TableName, Location, Partition, [ColumnId], ColumnName, ColumnType, [SegmentElimination], [DealignedSegments], [TotalSegments], SegmentAlignment)
(TableName, Location, Partition, [ColumnId], ColumnName, ColumnType, [SegmentElimination], [PredicatePushdown], [DealignedSegments], [TotalSegments], SegmentAlignment)
values
('[dbo].[OneRowNCI_Clustered]', 'Disk-Based', 1, 1, 'c1', 'int', 'OK', 0, 1, 100.00 );
('[dbo].[OneRowNCI_Clustered]', 'Disk-Based', 1, 1, 'c1', 'int', 'OK', 'OK', 0, 1, 100.00 );

insert into #ActualAlignment
exec dbo.cstore_GetAlignment @tableName = 'OneRowNCI_Clustered';
Expand Down
3 changes: 2 additions & 1 deletion Tests/SQL-2012/Alignment_testEmptyTable.sql
Expand Up @@ -31,7 +31,8 @@ BEGIN
ColumnId int,
ColumnName nvarchar(256),
ColumnType nvarchar(256),
SegmentElimination varchar(50),
SegmentElimination varchar(25) NOT NULL,
PredicatePushdown varchar(25) NOT NULL,
DealignedSegments int,
TotalSegments int,
SegmentAlignment Decimal(8,2)
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -66,7 +67,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'Disk-Based' Index Location
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand All @@ -79,7 +80,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'Disk-Based' Index Location
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -66,7 +67,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'Disk-Based' Index Location
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -65,7 +66,7 @@ BEGIN

-- Insert expected result for 499999 rows
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand All @@ -78,7 +79,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for 500000 rows
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -66,7 +67,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for 0.005 GB
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand All @@ -79,7 +80,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for 0.006 GB
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -65,7 +66,7 @@ BEGIN

-- Insert expected result for the 'DB' Schema - the results should be empty
insert into #ActualSuggestedTables
exec dbo.cstore_SuggestedTables @schemaName = 'db', @tableName = 'SuggestedTables_Test1'
exec dbo.cstore_SuggestedTables @schemaName = 'dbx', @tableName = 'SuggestedTables_Test1'

exec tSQLt.AssertEqualsTable '#ExpectedSuggestedTables', '#ActualSuggestedTables';
TRUNCATE TABLE #ExpectedSuggestedTables;
Expand All @@ -75,7 +76,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'DBO' Schema
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down
Expand Up @@ -32,6 +32,7 @@ BEGIN
[Compatible With] varchar(50) NOT NULL,
[TableLocation] varchar(15) NOT NULL,
[TableName] nvarchar(1000) NOT NULL,
[Partitions] int NOT NULL,
[Row Count] bigint NOT NULL,
[Min RowGroups] smallint NOT NULL,
[Size in GB] decimal(16,3) NOT NULL,
Expand Down Expand Up @@ -66,7 +67,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'Disk-Based' Index Location
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand All @@ -79,7 +80,7 @@ BEGIN
-- ******************************************************************************************************
-- Insert expected result for the 'Disk-Based' Index Location
insert into #ExpectedSuggestedTables
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 500000, 1, 0.006, 1, 0, 4,
select 'Nonclustered Columnstore', 'Disk-Based', '[dbo].[SuggestedTables_Test1]', 1, 500000, 1, 0.006, 1, 0, 4,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 0,*/ 0, 0, 0;

insert into #ActualSuggestedTables
Expand Down

0 comments on commit 781718c

Please sign in to comment.