ToysMall
V2EX  ›  问与答

MySql5.6 2000 万行, 5G 数据 , alter table 列类型大概需要多长时间?

  •  
  •   ToysMall · Oct 8, 2015 · 3326 views
    This topic created in 4062 days ago, the information mentioned may be changed or developed.
    6 replies  •  2015-10-09 11:39:00 +08:00
    hellojinjie
    hellojinjie
    Oct 8, 2015
    1
    还不如先 select into outile
    然后重建表
    然后再 insert into from file
    kslr
    kslr
    Oct 8, 2015 via Android
    2
    几个小时,如果列不是很多的话
    nowcoder
    nowcoder
    Oct 8, 2015
    3
    20 分钟左右
    msg7086
    msg7086
    Oct 9, 2015
    4
    @hellojinjie alter table 就是这个过程,而且少个序列化。
    hellojinjie
    hellojinjie
    Oct 9, 2015
    5
    @msg7086 直接 alter 应该还有锁表这一个过程,还有包括事务、日志相关的操作,所以应该会更耗时一些。如果直接 alter ,也有可能会报缓存不足的错误的。
    msg7086
    msg7086
    Oct 9, 2015
    6
    @hellojinjie 没记错的话应该是先做 copy to temp table 然后再重做索引。不太清楚你说的那几个。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2129 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:20 · PVG 11:20 · LAX 19:20 · JFK 22:20
    ♥ Do have faith in what you're doing.