whx20202
V2EX  ›  问与答

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

  •  
  •   whx20202 · Jun 20, 2018 · 2647 views
    This topic created in 2908 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   ·   1066 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:20 · PVG 02:20 · LAX 11:20 · JFK 14:20
    ♥ Do have faith in what you're doing.