MySQL partition experimentBrief:I. Partitioning by partition typeII. Administrative Divisionexamples of partitions and non-partitioned tables
first, establish the partition to hash partition for example
(1), non-linear hash partition
1. Test table T_hash Structure
CREATE TABLE T_hash (id int unsigned, Name Char (1) ) Engine=myisam Charset=utf8 Partition by hash (ID) Partitions 5; |
|
2. T_hash Table physical file structure
3. Insert data into the T_hash table
4. View the physical structure of the table T_hash
Summary: Hash Partitioning is an average distribution. Therefore, the data file size for each partition is equal.
II. Administrative Division
1, for the hash partition
2. Adjust the partition number 5 to 2
3. Adjust the partition number 2 to 1
Summary: Once the hash is partitioned, at least one partition exists.
examples of partitions and non-partitioned tables
1. Test table
Non-partitioned table: CREATE TABLE T2 (id int unsigned, Name Char (1) ) Engine=myisam Charset=utf8; |
|
Partition table: CREATE TABLE T1 (id int unsigned, Name Char (1) ) Engine=myisam Charset=utf8 Partition by hash (ID) Partitions 4; |
|
2. Inserting data with the same number of bars
3. Find data with Name a
(Note: Partitioning takes less time than unpartitioned if no index is added)
The quieter become,the more you is able to hear!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Small shell _mysql Partition instance