haosamax
V2EX  ›  问与答

DB2 在线重构表 数据量大怎么办

  •  
  •   haosamax · Dec 12, 2018 · 1775 views
    This topic created in 2750 days ago, the information mentioned may be changed or developed.

    一张表们没有主键,数据量大概四五十万,添加了个主键,在线重构会等待 20-30 秒,影响业务。有什么好的办法?(已经解决了,用的 runstates,比 reorg 快些,这里想听听大家的意见)

    7 replies    2018-12-13 13:42:52 +08:00
    yangg
        1
    yangg  
       Dec 12, 2018 via iPhone
    不用这么久吧,准备明天早上把 150w 的 pg 数据加个索引
    haosamax
        2
    haosamax  
    OP
       Dec 12, 2018 via Android
    测试环境 20 多秒,把生产数据导出来模拟的
    haosamax
        3
    haosamax  
    OP
       Dec 12, 2018 via Android
    @yangg
    测试环境 20 多秒,把生产数据导出来模拟的
    yangg
        4
    yangg  
       Dec 12, 2018 via iPhone
    @haosamax 测试环境有生产的一半性能?
    F281M6Dh8DXpD1g2
        5
    F281M6Dh8DXpD1g2  
       Dec 12, 2018   ❤️ 1
    online ddl 了解一下
    haosamax
        6
    haosamax  
    OP
       Dec 12, 2018 via Android
    @liprais mysql 的的吗,我搜了下都是 mysql
    yangg
        7
    yangg  
       Dec 13, 2018
    早上给数据加了索引,只用了不到 2s (刚才 count 了一下,只有 127w,分表了不能用 pg 的 create index concurrently )
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5381 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 05:55 · PVG 13:55 · LAX 22:55 · JFK 01:55
    ♥ Do have faith in what you're doing.