[SERVER-28183] Find slow with regex, geoWithin and sort Created: 03/Mar/17 Updated: 31/May/17 Resolved: 13/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sergey Kazankov | Assignee: | Mark Agarunov |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
I have the unstable query which can take from 1 second to 400 (!!!) seconds. Here it is:
indexes:
statistics: Without limit:
66427 is much better than 70 and it is probably bad. With other name:
Much faster! But totalDocsExamined is only 3939. And with limit! :
401 seconds! With all indexes. |
| Comments |
| Comment by Mark Agarunov [ 09/Mar/17 ] | ||||||||||
|
Hello kazankov, Thank you for the report. Looking over the output provided, it seems that a compound index would be far more optimal for this query. The currently existing indices will not be fully utilized with the type of query shown. Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. Additionally, see also our Technical Support page for additional support resources. Thanks, | ||||||||||
| Comment by Sergey Kazankov [ 03/Mar/17 ] | ||||||||||
|
P.S.:
| ||||||||||
| Comment by Sergey Kazankov [ 03/Mar/17 ] | ||||||||||
|
"66427 is much better than 70" -> "66427 is much bigger than 70" |