在数据库中有多少行是TOO MANY? [英] How many rows in a database are TOO MANY?
问题描述
我有一个MySQL InnoDB表,有1,000,000条记录。这太多了吗?或者数据库可以处理这个和更多?我问,因为我注意到一些查询(例如,从表中获取最后一行)在表中有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.
推荐答案
我有一个MySQL InnoDB表有1000000个寄存器。这太多了吗?
I've a MySQL InnoDB table with 1000000 registers. Is this too much?
不,1,000,000个行(AKA记录) 。
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:
- 查询不太好
- 不使用主键,
- 设计不佳的数据模型(表结构)
- 缺少索引
- Poorly written query
- Not using a primary key, assuming one even exists on the table
- Poorly designed data model (table structure)
- Lack of indexes
这篇关于在数据库中有多少行是TOO MANY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!