SQL Server database partition table-mysql tutorial

Source: Internet
Author: User
SQLServer database partition table SQLServer This article introduces an SQLServer database partition table application instance. through this instance, we can conclude that creating a partition table can optimize the query efficiency. Next let's take a look at this instance. AD: uses the SQLServer database to create an online game account sending system. The function is to import N card numbers from the vendor.

SQL Server database partition table SQL Server This article introduces an SQL Server database partition table application instance. through this instance, we can conclude that creating a partition table can optimize the query efficiency. Next let's take a look at this instance. AD: uses the SQL Server database to create an online game account sending system. The function is to import N card numbers from the vendor.

SQL Server database partition table SQL Server
This article introduces an SQL Server database partition table application instance. through this instance, we can conclude that creating a partition table can optimize the query efficiency. Next let's take a look at this instance. AD: uses the SQL Server database to create an online game account sending system. The function is to import the N card numbers provided by the vendor to the library for users at a fixed time. The biggest highlight of this system is the uncertainty of N. the number of cards provided by different vendors varies, and N may be 10 or. After analysis, the table structure is as follows: now we have a simple test. we inserted million pieces of data in this table, and then randomly queried one piece of data based on the ActivityID. it took more than 4 seconds .. Therefore, we decided to try to use a partition table to optimize the query efficiency. The partition function is AS follows: create partition function [Card_PF] (int) as range left for values (500,100 0, 1500,200 0, 2500,300 0) Here I use ActivityID AS the PARTITION condition. Each 500 activities are in one zone. The partitioning SCHEME is AS follows: create partition scheme [Card_PS] as partition [Card_PF] TO ([Card1], [Card2], [Card3], [Card4], [Card5], [Card6], [Card7]) is the corresponding file and file group: Next is the most critical step. add an aggregate index to the table and use the partition solution created above: so far, the partition table has been created. for better test results, I have inserted pieces of data in the newly created table. The same SQL statement runs in about 1 second.

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.