Closed dunckerr closed 2 years ago
I rebased this branch to pull in the fixed tests. The actual issue this PR fixes in arctic._util.mongo_count() in _util.py which used to run very slowly with filter == {}, and pymongo 3.11.0.
@shashank88 @bmoscon @jamesblackburn can you guys check this please? Note I rebased master to pull in all the py3.6 test changes. The actual change here is in arctic/_util.py, where we avoid calling count_documents() with filter={} and pymongo drivers > 3.6.0. That scenario was killing the database with COLLSCANs when the caller really just wanted to know how many docs in the collection. The new code path calls estimate_document_count() which is super fast.
I rebased this branch to pull in the fixed tests. The actual issue this PR fixes in arctic._util.mongo_count() in _util.py which used to run very slowly with filter == {}, and pymongo 3.11.0.