ukipoi
V2EX  ›  问与答

对于数据库的批量插入, for 循环插入和 sql 语句拼接之间有什么区别?

  •  
  •   ukipoi · Jun 10, 2019 · 2451 views
    This topic created in 2562 days ago, the information mentioned may be changed or developed.

    为什么 JPA 的 saveAll 和 MybatisPlus 的 savebatch 都是以 for 循环的方式实现的?(还是说我看错了)

    1 replies    2019-06-10 11:13:01 +08:00
    leon0903
        1
    leon0903  
       Jun 10, 2019
    循环插入是多次 sql 链接的执行吧,sql 拼接只有一次链接的执行。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3273 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:09 · PVG 21:09 · LAX 06:09 · JFK 09:09
    ♥ Do have faith in what you're doing.