gpt4 book ai didi

mysql - 将数据从一个表移动到第二个表会提高更新速度吗?

转载 作者:行者123 更新时间:2023-11-30 00:42:20 25 4
gpt4 key购买 nike

我有一个大约有 300K 条记录的大型 MyISAM 表。其中大部分是短字符串和整数,但是,一个字段包含每条记录约 5-10K 的压缩数据。数据字段很少更新,但其他字段每小时更新几次。

如果我将数据字段移动到主键引用的另一个表中,是否会加快表选择/更新的速度?

最佳答案

It is normally not useful to split a table into different tables just because the rows become large. In accessing a row, the biggest performance hit is the disk seek needed to find the first byte of the row. After finding the data, most modern disks can read the entire row fast enough for most applications. The only cases where splitting up a table makes an appreciable difference is if it is a MyISAM table using dynamic row format that you can change to a fixed row size, or if you very often need to scan the table but do not need most of the columns. See Chapter 14, Storage Engines.

我认为您的情况适合最后一种情况,所以是的它会加快选择速度。 (也许不更新)

来源:http://dev.mysql.com/doc/refman/5.5/en/optimizing-queries-myisam.html

关于mysql - 将数据从一个表移动到第二个表会提高更新速度吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21664014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com