当前位置:网站首页>mysql 大表的拆分方式
mysql 大表的拆分方式
2022-06-11 17:07:00 【jacklin_001】
一.横向拆分
create table 新表的名称 select * from 被拆分的表 order by id limit int1,int2 int1为其实位置,int2为几条
注意:这样拆分后主键会失效手动让其主键生效即可所有要执行
alter table 新表的名称 modify 主键字段 int primary key auto_increment
二.纵向拆分
create table 新表的名称 select 需保留的字段 from 被拆分的表
拆分后原表都要保存
主要是把经常查的数据放在一个表里,不经常查的数据不做处理
边栏推荐
- LeetCode——42. Connected to rainwater (double pointer)
- solr(一)solr的安装及权限控制
- 数据库全量SQL分析与审计系统性能优化之旅
- 网络流媒体协议的联系与区别(RTP RTCP RTSP RTMP HLS)
- Is the securities account given by qiniu business school safe? Do you charge for opening an account
- Persistence mechanism of redis
- 消息队列-推/拉模式学习 & ActiveMQ及JMS学习
- Pychart tips - how to set up a background picture
- Science popularization genius on the left, madman on the right
- 基于文本驱动用于创建和编辑图像(附源代码)
猜你喜欢

Pychart tips - how to set up a background picture

WYSIWYG markdown editor: typora

Research Report on operation mode and investment opportunities of China's aluminum industry 2022-2028

Environment configuration and pymysql installation

TypeScript学习笔记(二)

Common tools and commands for information collection

基于文本驱动用于创建和编辑图像(附源代码)

Guide to Dama data management knowledge system: percentage of chapter scores

Switching power supply circuit diagram and principle 12V analysis - detailed version
Persistence mechanism of redis
随机推荐
JSP page initial loading method
Learning C language from scratch day 039
web安全-靶场笔记
美团获得小样本学习榜单FewCLUE第一!Prompt Learning+自训练实战
API management artifact that allows you to call wow directly
LeetCode——42. 接雨水(双指针)
虚拟局域网划分与虚拟局域网间路由(VLAN)
Connection and difference of network streaming media protocol (RTP RTCP RTMP HLS)
VLAN partition and routing between VLANs
闭包的简单理解
Development planning of China's stainless steel market and suggestions on the development direction of the 14th five year plan 2022-2028
Error: error summary of pointer as function parameter
Opencv相机标定之圆形标识点中心检测
每周推荐短视频:菜鸟CEO谈未来物流新赛道
启牛商学院给的证券账户是安全的吗?开户收费吗
A set of ThinkPHP wechat applet mall source code with background management
Redis --- 学习 NoSQL 五大类型
GemBox.Bundle 43.0 Crack
Guide to Dama data management knowledge system: percentage of chapter scores
(验证文件)validateJarFile...报错