Is countDocuments() speed in DocumentDB depends on document size?

170 Views Asked by At

I found that countDocuments() take different time in different copy of the same db. The case is next:

  • counts documents same (about 70k)
  • structure documents the same
  • instance the same 4vcpu і 32 ram.

Slower db stats: enter image description here Faster db stats: enter image description here

As you can see slower db has bigger "avgObjSize" more than 10 times. And "countDocuments({filter})" with the same filter runs 10 times longer.

Еhere is some dependence on the avgObjSize(storageSize) and counting documents? Or how I can speed up counting?

0

There are 0 best solutions below