当前位置:网站首页>Splitting method of MySQL large tables

Splitting method of MySQL large tables

2022-06-11 17:08:00 jacklin_ 001

One . Horizontal resolution

create table The name of the new table select * from Split table order by id limit int1,int2 int1 In fact, the location ,int2 How many

Be careful : In this way, after splitting, the primary key will be invalid. You can manually make the primary key effective, and then you can execute it

alter table The name of the new table modify Primary key field int primary key auto_increment

Two . Vertical resolution

create table The name of the new table select Fields to keep from Split table

After splitting, the original table should be saved

The main thing is to put the frequently checked data in a table , Do not process data that are not checked frequently

原网站

版权声明
本文为[jacklin_ 001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111706521203.html