whx20202
V2EX  ›  问与答

批量删除 redis 几个 hash 的 field,那么是 pipeline 好还是直接可变参数好?

  •  
  •   whx20202 · Jun 20, 2018 · 2611 views
    This topic created in 2888 days ago, the information mentioned may be changed or developed.
                jedis = jedisPool.getResource();
                Pipeline p = jedis.pipelined();
                for (String each : keySet) {
                    p.hdel(name, each);
                }
                p.sync();
    
            jedis = jedisPool.getResource();
            jedis.hdel(name, fieldList)
    

    这两种哪个好?网上很难找到具体的说明,都在说事务什么的

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