-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance Regression in Count Query with Indexed Field #3191
Comments
Could you enable logs and report the query that is executed on both package versions? DB::enableQueryLog();
// The query
dd(DB::getQueryLog()); |
Version 4.8.0
Version 5.0.0
|
Thanks. Both commands are identical (in 4.8, you see the high level API, and in 5.0 you see the actual server command). So the performance difference is due to something in the code. It there the same time difference when you disable query logs? |
@GromNaN
|
I can't reproduce the time difference with a collection of the same size. |
The MongoDB on the server is still running on version v4.2.25. We’ll be upgrading incrementally, and I’ll keep you updated on the results once we reach the latest release. |
Description:
I am experiencing a significant performance regression when counting documents in the reefer_measurements collection using the reefer_id index.
Index created on reefer_id:
When executing the following query to count documents:
I observed the following performance times:
Environment:
Steps to reproduce
Expected behaviour
The count operation should be optimized and utilize the index effectively, resulting in a much lower execution time.
Actual behaviour
The execution time has increased dramatically from version 4.8.0 to 5.0.0, leading to degraded performance in applications relying on this count query.
I would appreciate any guidance on potential causes for this performance regression and suggestions for optimization.
The text was updated successfully, but these errors were encountered: