我在某处听说您应该在表中的所有其他类型之前拥有int类型字段.他们说查询运行得更快.这是真的?
例如 –
> id int(10)
>时间int(11)
> user_id整数(10)
>标题varchar(128)
>文字文字
…代替:
最佳答案
我敢肯定这不会有太大的不同,但是您可以对大型数据集进行基准测试.我搜索了出色的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.