-
Notifications
You must be signed in to change notification settings - Fork 0
/
inmem_comparison.sql
185 lines (158 loc) · 3.2 KB
/
inmem_comparison.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
set statistics time on
GO
USE CMS
GO
EXEC dbo.Product_By_Date '2016-06-01', '2016-06-30'
GO
--24s
USE CMSMem
GO
EXEC dbo.Product_By_Date '2016-06-01', '2016-06-30'
GO
--3s
USE Columnstore
GO
EXEC dbo.Product_By_Date '2016-06-01', '2016-06-30'
GO
--826ms
USE CMSMemCI
GO
EXEC dbo.Product_By_Date '2016-06-01', '2016-06-30'
GO
--826ms
--------------------------------------------------
USE CMS
GO
EXEC dbo.Product_by_Territory_Date '2016-06-01', '2016-06-30'
GO
--12s
USE CMSMem
GO
EXEC dbo.Product_by_Territory_Date '2016-06-01', '2016-06-30'
GO
--3s
USE Columnstore
GO
EXEC dbo.Product_by_Territory_Date '2016-06-01', '2016-06-30'
GO
--8.8s
USE CMSMemCI
GO
EXEC dbo.Product_by_Territory_Date '2016-06-01', '2016-06-30'
GO
--8.8s
--------------------------------------------------
USE CMS
GO
EXEC dbo.Product_Ship_Delays_by_Age_Date 7, '2016-06-01', '2016-06-30'
GO
--0.353s
USE CMSMem
GO
EXEC dbo.Product_Ship_Delays_by_Age_Date 7, '2016-06-01', '2016-06-30'
GO
--0.363s
USE Columnstore
GO
EXEC dbo.Product_Ship_Delays_by_Age_Date 7, '2016-06-01', '2016-06-30'
GO
--0.301s
USE CMSMemCI
GO
EXEC dbo.Product_Ship_Delays_by_Age_Date 7, '2016-06-01', '2016-06-30'
GO
--0.301s
--------------------------------------------------
USE CMS
GO
EXEC dbo.Product_Ship_Delays_by_Date '2016-06-01', '2016-06-30'
GO
--124221ms
USE CMSMem
GO
EXEC dbo.Product_Ship_Delays_by_Date '2016-06-01', '2016-06-30'
GO
--860ms
USE Columnstore
GO
EXEC dbo.Product_Ship_Delays_by_Date '2016-06-01', '2016-06-30'
GO
--301ms
USE CMSMemCI
GO
EXEC dbo.Product_Ship_Delays_by_Date '2016-06-01', '2016-06-30'
GO
--301ms
--------------------------------------------------
USE CMS
GO
EXEC dbo.Sales_By_Territory_Date '2016-06-01', '2016-06-30'
GO
--226ms
USE CMSMem
GO
EXEC dbo.Sales_By_Territory_Date '2016-06-01', '2016-06-30'
GO
--1236ms
USE Columnstore
GO
EXEC dbo.Sales_By_Territory_Date '2016-06-01', '2016-06-30'
GO
--120ms
USE CMSMemCI
GO
EXEC dbo.Sales_By_Territory_Date '2016-06-01', '2016-06-30'
GO
--120ms
--------------------------------------------------
USE CMS
GO
EXEC dbo.Sales_By_Territory_Rep_Date '2016-06-01', '2016-06-30'
GO
--324ms
USE CMSMem
GO
EXEC dbo.Sales_By_Territory_Rep_Date '2016-06-01', '2016-06-30'
GO
--282ms
USE Columnstore
GO
EXEC dbo.Sales_By_Territory_Rep_Date '2016-06-01', '2016-06-30'
GO
--251ms
USE CMSMemCI
GO
EXEC dbo.Sales_By_Territory_Rep_Date '2016-06-01', '2016-06-30'
GO
--251ms
--------------------------------------------------
--Update random sales reps
SET STATISTICS TIME ON
GO
USE CMS
GO
DECLARE @OldRepID INT, @NewRepID INT
SELECT TOP 1 @OldRepID = SalesRepID FROM dbo.SalesRep ORDER BY NEWID()
SELECT TOP 1 @NewRepID = SalesRepID FROM dbo.SalesRep ORDER BY NEWID()
-- So we can transpose the item to the
-- in-memory command for continuity in operations
PRINT @OldRepID
PRINT @NewRepID
EXEC dbo.Sales_Rep_Reassign @OldRepID, @NewRepID
GO
--148ms
USE CMSMem
GO
EXEC dbo.Sales_Rep_Reassign 4652, 1265
GO
--6ms
USE Columnstore
GO
EXEC dbo.Sales_Rep_Reassign 4652, 1265
GO
--19ms
USE CMSMemCI
GO
EXEC dbo.Sales_Rep_Reassign 4652, 1265
GO
--19ms