


Detailed explanation of adding deletion processing examples for MySQL 5.5 range partition
This article mainly introduces you to the relevant information about the MySQL 5.5 range partition addition and deletion processing. The article introduces it in detail through the example code, which has certain reference and learning value for everyone. Friends who need it can take a look below.
Introduction
RANGE partitioning is based on a given continuous interval range. Early versions of RANGE were mainly based on integer partitioning. In version 5.7, DATE and DATETIME columns can also use RANGE partitioning, and versions above 5.5 provide non-shaping-based RANGE COLUMN partitioning. RANGE partitions must be contiguous and cannot overlap. Use
"VALUES LESS THAN ()" to define the partition interval. Non-integer range values need to use single quotes, and MAXVALUE can be used as the highest value of the partition.
This article will introduce to you the relevant content of adding and deleting the MySQL 5.5 range partition, and share it with you for your reference and study. Let’s take a look at the detailed introduction:
1. Delete partitions
##查看要处理的分区的数据量,并导出作为备份 mysql> select count(*) from baby_account_change_log where updated_time >'2016-12-01 00:00:00' and updated_time select * into outfile '/tmp/baby_account_change_log_p1.sql' from baby_account_change_log where updated_time >'2016-12-01 00:00:00' and updated_time explain partitions select count(*) from baby_account_change_log where updated_time >'2016-12-01 00:00:00' and updated_time alter table baby_account_change_log drop partition p0; Query OK, 0 rows affected (0.01 sec)
2. Add partitions
#错误提示删除存储最大值分区 mysql> alter table baby_account_change_log add partition(PARTITION p13 VALUES LESS THAN (unix_timestamp('2017-12-31 23:59:59'))); ERROR 1481 (HY000): MAXVALUE can only be used in last partition definition #删除存储最大值分区 mysql> alter table baby_account_change_log drop partition p12; ##增加新的分区 mysql> alter table baby_account_change_log add partition(PARTITION p12 VALUES LESS THAN (unix_timestamp('2017-12-31 23:59:59')));
Related recommendations:
Mysql partitions and range partitions detailed introduction
mysql partitions Management-range partition_MySQL
MySQLrange partition (2)_MySQL
The above is the detailed content of Detailed explanation of adding deletion processing examples for MySQL 5.5 range partition. For more information, please follow other related articles on the PHP Chinese website!

TodropaviewinMySQL,use"DROPVIEWIFEXISTSview_name;"andtomodifyaview,use"CREATEORREPLACEVIEWview_nameASSELECT...".Whendroppingaview,considerdependenciesanduse"SHOWCREATEVIEWview_name;"tounderstanditsstructure.Whenmodifying

MySQLViewscaneffectivelyutilizedesignpatternslikeAdapter,Decorator,Factory,andObserver.1)AdapterPatternadaptsdatafromdifferenttablesintoaunifiedview.2)DecoratorPatternenhancesdatawithcalculatedfields.3)FactoryPatterncreatesviewsthatproducedifferentda

ViewsinMySQLarebeneficialforsimplifyingcomplexqueries,enhancingsecurity,ensuringdataconsistency,andoptimizingperformance.1)Theysimplifycomplexqueriesbyencapsulatingthemintoreusableviews.2)Viewsenhancesecuritybycontrollingdataaccess.3)Theyensuredataco

TocreateasimpleviewinMySQL,usetheCREATEVIEWstatement.1)DefinetheviewwithCREATEVIEWview_nameAS.2)SpecifytheSELECTstatementtoretrievedesireddata.3)Usetheviewlikeatableforqueries.Viewssimplifydataaccessandenhancesecurity,butconsiderperformance,updatabil

TocreateusersinMySQL,usetheCREATEUSERstatement.1)Foralocaluser:CREATEUSER'localuser'@'localhost'IDENTIFIEDBY'securepassword';2)Foraremoteuser:CREATEUSER'remoteuser'@'%'IDENTIFIEDBY'strongpassword';3)Forauserwithaspecifichost:CREATEUSER'specificuser'@

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!
