How many rows in a database are TOO MANY?(数据库中有多少行是 TOO MANY?)
问题描述
我有一个包含 1,000,000 条记录的 MySQL InnoDB 表.这太多了吗?或者数据库可以处理这个以及更多?我问是因为我注意到某些查询(例如,从表中获取最后一行)在具有 1 百万行的表中比在具有 100 行的表中慢(秒).
I've a MySQL InnoDB table with 1,000,000 records. Is this too much? Or databases can handle this and more? I ask because I noticed that some queries (for example, getting the last row from a table) are slower (seconds) in the table with 1 millon rows than in one with 100.
推荐答案
我有一个包含 1000000 个寄存器的 MySQL InnoDB 表.这太多了吗?
I've a MySQL InnoDB table with 1000000 registers. Is this too much?
不,1,000,000 行(也称为记录)对于数据库来说不算太多.
No, 1,000,000 rows (AKA records) is not too much for a database.
我之所以这么问是因为我注意到有些查询(例如,获取表的最后一个寄存器)在具有 100 万个寄存器的表中比在具有 100 个寄存器的表中慢(秒).
I ask because I noticed that some queries (for example, getting the last register of a table) are slower (seconds) in the table with 1 million registers than in one with 100.
该声明中有很多内容需要说明.通常的嫌疑人是:
There's a lot to account for in that statement. The usual suspects are:
- 写得不好的查询
- 不使用主键,假设表中存在主键
- 设计不佳的数据模型(表结构)
- 缺乏索引
这篇关于数据库中有多少行是 TOO MANY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:数据库中有多少行是 TOO MANY?


基础教程推荐
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01