MySQL partition those things

Source: Internet
Author: User

The partition in MySQL has range, list, hash, key four kinds of partitioning methods
We introduce the Range method here, and others can digest

Partitioning an existing table (range mode)

ALTER table name PARTITION by range (field name) (PARTITION partition name values less  THAN (field value));
Alter TABLE  by Range (ID) (        values less than (+),        values less than (20  ),        VALUES less than (MAXVALUE));

View partition status

SELECT *  from User_log

Query development Zoning

SELECT *  from user_log PARTITION (user_log_a); SELECT *  from user_log PARTITION (user_log_b); Select *  from User_log PARTITION (User_log_c);

Other Operations Commands

Merging Alter Table       into values less than (XX)); Delete partition ALTER TABLE  Table name drop partition partition name (lost data) Delete partition (do not drop data)Altertable news_main Remove partitioning;

MySQL partition those things

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.