[SERVER-18830] Explain on near query with limit leaves out last search interval Created: 04/Jun/15 Updated: 05/Feb/16 Resolved: 17/Jun/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.5 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Brandon Zhang |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | To reproduce, first generate a geo collection. The following script will generate a uniform density dataset around (10,10)
Now, run the following query:
In the output, you will see the following (modified for readability):
The number of inputStages is 3, but the number of displayed searchIntervals is only 2. They should be equal. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | RPL 5 06/26/16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
When performing an explain("executionStats") on a $near query, the searchIntervals field should contain all of the annuluses which are scanned. However, when a query is done with a limit, like the following:
The number of searchIntervals on the GEO_NEAR_2DSPHERE stage is one less than it should be. It should equal the number of inputStages. The reason this occurs is because in near.cpp, the method NearStage::advanceNext will only add to the intervalStats when the current buffer is finished. The limit will end early, before the buffer finishes. Therefore, the annulus will never be reported. |
| Comments |
| Comment by Githook User [ 17/Jun/15 ] |
|
Author: {u'name': u'Brandon Zhang', u'email': u'brandonzhang@Brandons-MacBook-Pro-2.local'}Message: Closes #987 Signed-off-by: Siyuan Zhou <siyuan.zhou@mongodb.com> |