Recommended Services
› Amazon Web Services
› LeanCloud
› New Relic
› ClearDB
cyxsnd
V2EX  ›  云计算

循环添加 50000 条数据到 List 集合特别慢怎么办

  •  
  •   cyxsnd · May 24, 2018 · 5061 views
    This topic created in 3100 days ago, the information mentioned may be changed or developed.
    如果要修改 40000 条数据到 mysql 怎么样可以快一点。
    添加 40000 条数据到 List 中,怎么样可以快一点。
    6 replies  •  2018-05-25 11:34:48 +08:00
    DerekXu
    DerekXu
    May 24, 2018
    1
    用 JDBC 的话,修改数据库,可以使用:batch upate
    添加到 list ?能描述的详细一点?
    weizhen199
    weizhen199
    May 24, 2018
    2
    啥意思?到底读还是写?
    cyxsnd
    cyxsnd
    OP
    May 24, 2018
    3
    gabon
    gabon
    May 24, 2018 via Android
    4
    多线程单线程? arraylist 还是 linkedlist ?
    Mazexal
    Mazexal
    May 24, 2018
    5
    insert xx (xxx,xxx,xx) values (x1,x2,x3),(x1,x2,x3),(x1,x2,x3),(x1,x2,x3).....需要设置 mysql 字符串的最大链接长度
    sutra
    sutra
    May 25, 2018
    6
    mysql 没有 List 这样的概念吧。
    如果是批量向 mysql 的表插入数据,可以试试调整 batch size。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1148 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:27 · PVG 07:27 · LAX 15:27 · JFK 18:27
    ♥ Do have faith in what you're doing.