jrient
V2EX  ›  问与答

Union 多表查询 和 单表多次查询 哪个对服务器的压力小?

  •  
  •   jrient · Jul 6, 2018 · 2253 views
    This topic created in 2873 days ago, the information mentioned may be changed or developed.

    最近在做数据统计脚本,统计用户等数据,数据量非常大。 100 张表 * 每表 1kw+数据。 后台执行的定时脚本,对性能没要求。

    考虑了以下几个方案

    1. union 连表查
    2. 循环多表查
    3. 循环多表查 + sleep(1)

    问问站内大佬们的看法

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1100 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 22:54 · PVG 06:54 · LAX 15:54 · JFK 18:54
    ♥ Do have faith in what you're doing.