codingAlex
V2EX  ›  问与答

v 友们,更新百万级的数据有哪些方案?

  •  
  •   codingAlex · Jun 7, 2023 · 1209 views
    This topic created in 1070 days ago, the information mentioned may be changed or developed.

    数据库有七八百万的数据,在批量调度模块里面,直接使用 select 然后 update ,一次 select 这么多并进行更新,会造成 SQL 阻塞,这种情况下,有哪些好的方案解决呢?

    3 replies    2023-06-08 13:01:09 +08:00
    F281M6Dh8DXpD1g2
        1
    F281M6Dh8DXpD1g2  
       Jun 7, 2023
    直接 update 完事
    gabon
        2
    gabon  
       Jun 8, 2023 via iPhone
    select id from x where id> cursor limit 100; update x set foo=bar where id in ( a,b,c );
    codingAlex
        3
    codingAlex  
    OP
       Jun 8, 2023
    @liprais 这样卡死的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5514 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    ♥ Do have faith in what you're doing.