search

Home  >  Q&A  >  body text

Mongodb 性能问题.

我知道 Mysql 用 count 的时候如果数据量大会很慢.

如果我在 mongodb 里用 .length 性能会怎么样呢?

大家讲道理大家讲道理2816 days ago562

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-25 09:06:24

    In mongodb, query performance still depends on whether the entire document needs to be traversed and whether to create an index.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-25 09:06:24

    It will be just as slow as the amount of data is large. For example: it took 0.001s to count 1,000 items, and 0.1s to count 1,000,000 items. It's faster if you have an index. As the amount of data increases, all kinds of problems arise.

    reply
    0
  • Cancelreply