First try ColumnStoreIndex

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.