gpt4 book ai didi

sql - 这是真的?表现问题

转载 作者:可可西里 更新时间:2023-11-01 08:23:06 29 4
gpt4 key购买 nike

我在某处听说您应该在表格中的所有其他类型之前使用您的 int 类型字段。他们说查询运行得更快或者什么的。这是真的吗?

例如-

  • id int(10)
  • 时间 int(11)
  • 用户 ID int(10)
  • 标题varchar(128)
  • 文字文字

...而不是:

  • id int(10)
  • 标题varchar(128)
  • 文字文字
  • 时间 int(11)
  • 用户 ID int(10)

最佳答案

我相信这不会有太大区别,但您可以对大型数据集进行基准测试以进行尝试。我搜索了优秀的MySQL Performance Blog供引用而没有找到任何东西。 MySQL manual section on optimization不得不说,这只是略有关联

For MyISAM tables, if you do not have any variable-length columns (VARCHAR, TEXT, or BLOB columns), a fixed-size row format is used. This is faster but unfortunately may waste some space. See Section 13.1.3, “MyISAM Table Storage Formats”. You can hint that you want to have fixed length rows even if you have VARCHAR columns with the CREATE TABLE option ROW_FORMAT=FIXED.

关于sql - 这是真的?表现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1483221/

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