First, use the non-clustered INDEX TIMEONSELECTMemberId, (VExpd) (DD, (DD, FactOrdersoWITH (INDEX (IX_IsBigOrder_O) to parse the result SQLServerparseandcompiletime: CPUtimems. SQLServe
First use non-clustered index time on SELECT MemberId, (VExpd) (DD, (DD, FactOrders o WITH (INDEX (IX_IsBigOrder_O )) isBigOrder MemberId result SQL Server parse and compile time: CPU time ms. SQL Serve
First try ColumnStore IndexPosted on
1. Use non-clustered indexes first
Time on select MemberId, (VExpd) (DD, (DD, FactOrders o WITH (INDEX (IX_IsBigOrder_O) IsBigOrder MemberId
Result
SQL Server parse and compile time: CPU time ms. SQL Server Execution Times: CPU time ms. SQL Server Execution Times: CPU time ms. (1121211 row (s) affected ). scan ahead reads 57581, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0 .. scan ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0 .. scan ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. SQL Server Execution Times: CPU time ms.
2. Use ColumnStore Index
Time on select MemberId, (VExpd) (DD, (DD, FactOrders o WITH (INDEX (IX_CS) IsBigOrder MemberId
Result
SQL Server Execution Times: CPU time ms. SQL Server parse and compile time: CPU time ms. SQL Server Execution Times: CPU time ms. SQL Server Execution Times: CPU time ms. (1121211 row (s) affected ). scan ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0 .. scan ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. SQL Server Execution Times: CPU time ms.
From the results of logical reads, we can see that there are significant differences: Hong Kong Space, CPU time and elapsed time are two times and three times, respectively.
3. Using ColumnStore Index cannot be as restrictive as using other non-clustered indexes. The restrictions for using ColumnStoreIndex are as follows:
1. A table can only have one ColumnStore Index
2. You cannot use a filter index.
3. The index must be partition-aligned.
4. the indexed table becomes a read-only table.
5. the indexed Column cannot be a computed column.
6. You cannot use the Include keyword.
Due to the limitation of 4th points, I was afraid of trouble before, so I was quite resistant. From this attempt, we can see that Hong Kong Space has greatly improved performance.
Plan to run for a while and follow up.
, Website Space