Table partitioning, which improves query efficiency for large data scale. The knowledge points involved in partitioning are:
One, create filegroups and files;
Second, create the partition function;
Third, create a partition scheme;
Four, partitioning the table;
Five, merge partition table.
One, create filegroups and files. Visual interface created like, code created here does not speak.
Second, create partition function, partition scheme. Create a partition by clicking Storage, table. For example, there are three districts, Gen Y, 2000, and the following are the people who were born:
Next, until the completion, the script is automatically generated, after execution, the table partition has been completed.
Third, merge the partition table. For example, merging 80, you need only 2 partitions.
Before merging, Gen Y had 20,000 data, leaving 80,000, merging, only one partition, and 100,000 data.
Alter PARTITION function Pf_born () Merge range (' 1990/01/01 ').
SELECT *
FROM dbo. T_user
WHERE $PARTITION. Pf_born (born) = 1
SQL Table Partitioning