This is an automated email from the ASF dual-hosted git repository.

cgivre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e0d2c6  DRILL-5177: Use much cheaper estimated record count when 
determining stats for a mongo scan (#2261)
8e0d2c6 is described below

commit 8e0d2c6a1b884bc917ec7ffb73d5697a97da5a14
Author: Jason Altekruse <[email protected]>
AuthorDate: Wed Jun 16 23:22:11 2021 -0500

    DRILL-5177: Use much cheaper estimated record count when determining stats 
for a mongo scan (#2261)
---
 .../src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
 
b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
index ef3041b..5867a72 100644
--- 
a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
+++ 
b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
@@ -492,7 +492,7 @@ public class MongoGroupScan extends AbstractGroupScan 
implements
       MongoClient client = storagePlugin.getClient();
       MongoDatabase db = client.getDatabase(scanSpec.getDbName());
       MongoCollection<Document> collection = 
db.getCollection(scanSpec.getCollectionName());
-      long numDocs = collection.countDocuments();
+      long numDocs = collection.estimatedDocumentCount();
 
       if (maxRecords > 0 && numDocs > 0) {
         recordCount = Math.min(maxRecords, numDocs);

Reply via email to