[SERVER-60830] Missing index scan bound in time-series query rewrite Created: 19/Oct/21 Updated: 29/Oct/23 Resolved: 05/Nov/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, 5.0.16 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Geert Bosch | Assignee: | Matt Boros |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||
| Backport Requested: |
v5.0
|
|||||||||||||||||||||
| Steps To Reproduce: |
Yields:
|
|||||||||||||||||||||
| Sprint: | QO 2021-11-01, QO 2021-11-15 | |||||||||||||||||||||
| Participants: | ||||||||||||||||||||||
| Description |
|
When you have an index on { meta:1, ts:1 }, and query on meta and ts greater than some value, you get a plan with only a bound on the control.max.ts field, but not on the control.min.ts field. This results in a complete index scan, which is expensive. Instead the query should use the bucketMaxSpanSeconds to bound the control.min.ts field. |
| Comments |
| Comment by Githook User [ 15/Mar/23 ] |
|
Author: {'name': 'Matt Boros', 'email': 'matt.boros@mongodb.com', 'username': 'mattBoros'}Message: (cherry picked from commit 406e8f1bebdc7e506b1dfcf013c528de53807e78) |
| Comment by Githook User [ 05/Nov/21 ] |
|
Author: {'name': 'Matt Boros', 'email': 'matt.boros@mongodb.com'}Message: |
| Comment by Geert Bosch [ 19/Oct/21 ] |
|
david.percy, this is the issue we talked about. |