fix(mongo) Change count_documents to estimated_document_count - #3243
fix(mongo) Change count_documents to estimated_document_count#3243zhuatuzilo wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb24b7124d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
count = db[table_name].count_documents({}) get_table_conut函数被调用的主要是两个地方: 可以考虑更优化下get_table_conut函数 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca2d2c9c56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
有道理,我改下 |
Optimize document count retrieval for large tables by using estimated count when above 1 million.
数据量较大时,使用count_documents 精确统计行数会影响到生产的负载,用estimated_document_count替换