Mysql partition management, mysql Partition

Source: Internet
Author: User

Mysql partition management, mysql Partition

The purpose of a hash partition is to evenly distribute data to each partition after hash calculation based on a column. Compared with range and list partitions, the hash partition does not need to explicitly specify a given column value or column value set.

Which partition should be stored in? mysql will automatically perform this operation based on hash calculation. We only need to specify a column or expression based on the column value to be hashed, and the number of optional partitions of the table to be partitioned.

The following is an example of how to create a hash partition. First, create the following table hash_partition_tbl and insert several records into the table, as shown below:

We also take a look at how the corresponding tablespace files are distributed (note that we have set innodb_file_per_table = 1, that is, each form has a unique ibd file ), we can see in the corresponding datadir directory:

Because we are divided into four hash partitions, we can see four tablespace files, which are hash_partition_tab.

Related Article

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.