MySQL List partition (3), mysqllist Partition

Source: Internet
Author: User

MySQL List partition (3), mysqllist Partition

For details, see MySQL partition 1.

Example: Here is my personal learning summary.






How does mysql partition existing tables?

I am also looking for a method. mysql has been able to partition tables since 5.1.

What is the relationship between the mysql partition field and the where condition?

1. Why is the number of records executed in two tables the same when no index is added? Is the partition field c3 required to be included in the where Condition for the partition to take effect?

Right.
Because you are still not partitioned. Where c2 = '1'
The final result is "full table scan"

For a partitioned table, each row in each partition must be scanned to see if the where c2 = '1' condition is met.
For unpartitioned tables, each row of the table is scanned.

2. After the index is added, the number of records executed in the partition of unpartitioned tables is even smaller. Why?

I guess the index on your partition table is a local index.
That is, when where c3 =... and c2 =..., we can achieve the best results.
When only where c2 =.

First, you must judge each partition in sequence and then use the index in that partition.
Therefore, the resource consumption is higher than that of the non-partition table.

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.