当前位置:网站首页>mysql 单表最多能存多少数据?
mysql 单表最多能存多少数据?
2022-07-29 06:51:00 【.海上月】
这里最近在做数据库的分库分表,在操作过程中发现一个问题,使用mycat分表,发现单表只能存500万数据,于是有了疑问?
mycat只能做500万的数据分表吗?
于是在本地模拟了一下,新建了一个数据表去执行数据插入,发现仍然单表只能做500万存储。
问了一下度娘,度娘的解释是,当数据量大到500万时,就要考虑分库分表,行业内的说法是单表推荐存储500万的数据量。可是这样好像不怎么高大上啊。咱要做的可是千万级甚至亿级别的数据优化。那按照这个方式,咱仍然要分好多表。达不到预期的效果。
看到有兄台的数据库单表居然能放一亿多条数据!这咋不一样了嘞。仔细往下看。有了新的说法。
实际上我们mysql的数据表上限是没这个说法的,因为mysql的存储量和mysql本身是没有多大关系的。那靠的是啥嘞。我总结了以下几点
1. 数据量的限制第一与你的操作系统有关,像上面提到的,在本地开发,大家借助了一些开发工具,比如Navicat这种,Navicat的单表限制就是在500万。那如果你是用线上的云服务器。根据你服务器内存的大小,会对你的数据量做一定得限制。比如是2GB的内存,数据量一般是2000万左右
2.根据你建表的主键有关,主键设置为id int 通常,这里int的位数可以做限制,如果你的int为32位,你的服务器内存足够大的情况下,这时你的数据量大概能存2^32-1条数据。主键要是设置成tyint,这时只能存储几百条数据了
如果你有不同的见解,可留在评论区
边栏推荐
- Win11 system error: code execution cannot continue because ierutil.dll cannot be found. Reinstalling the program may fix this problem
- 1172. The plate stack has a sequence table + stack
- Tp6 use protobuf
- MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
- tp6 使用 ProtoBuf
- ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
- [OpenGL] use of shaders
- VMware16安装虚拟机遇到的问题
- 时钟树综合(一)
- 微服务远程调用
猜你喜欢

VMware16安装虚拟机遇到的问题

聊天机器人有何用处?有何类型?看完这些就明白了!

Flink real time warehouse DWD layer (traffic domain) template code

Error 1045 (28000) access denied for user 'root' @ 'localhost' solution

MutationObserver文档学习

Full process flow of CMOS chip manufacturing

Image noise and matrix inversion

Win11vmware turns on the virtual machine and restarts on the blue screen and the solution that cannot be started

Operator3 - design an operator

MySQL 高级(进阶) SQL 语句 (一)
随机推荐
Leetcode 879. profit plan
WPF嵌套布局案例
330. 按要求补齐数组
Use vscode to configure Mysql to realize connection, query, and other functions
5-整合swagger2
After three years of outsourcing, the salary of automatic testing after job hopping is twice that of the original. The secret is
CAN&CANFD综合测试分析软件LKMaster与PCAN-Explorer 6分析软件的优势对比
Clock tree synthesis (I)
Student achievement ranking system based on C language design
Flink real-time warehouse DWD layer (order placing multiple tables to realize join operation) template code
Nodejs安装教程
vue-router路由缓存
接口测试实战项目03:执行测试用例
CVPR2021| 基于自监督学习的多视图立体匹配 (CVPR2021)
spark学习笔记(七)——sparkcore核心编程-RDD序列化/依赖关系/持久化/分区器/累加器/广播变量
数组的子集能否累加出K
以太网接口介绍
JS 鸡生蛋与蛋生鸡问题,Object与Function究竟谁出现的更早?Function算不算Function的实例?
[C language brush leetcode] 67. binary sum (E)
gin 参数验证