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.