[SERVER-15865] Remove batchSize from explain command shell helpers Created: 29/Oct/14  Updated: 06/Dec/22

Status: Open
Project: Core Server
Component/s: Querying
Affects Version/s: 2.7.8
Fix Version/s: features we're not sure of

Type: Task Priority: Major - P3
Reporter: Randolph Tan Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Execution
Participants:

 Description   

BatchSize does not make sense in explain and we should just remove it from the helper.

We should also consider rejecting explain commands with a batchSize.



 Comments   
Comment by J Rassi [ 29/Oct/14 ]

I see your point, though I think it's not necessarily bad to be able to show users that it doesn't have an effect on the explained query. I think this is a side effect of the explain design: our current explain implementation (as documented, though I don't think it's ideal) runs through the entire result set and returns execution stats for the entire query, but perhaps in the future we can explain one batch at a time, and/or indicate in the command response how each of the options would change execution of the query (note also that presence of the exhaust flag, the "no timeout" flag, and the tailable flag also don't have any effect on the explained query, but explain accepts them still).

Comment by Randolph Tan [ 29/Oct/14 ]

It is misleading that you can set something that has no effect and that can be confusing to users.

Comment by J Rassi [ 29/Oct/14 ]

I disagree on both counts. The legacy $explain path ignores batchSize, and I think that this is the correct design and that the explain command should follow suit (and I believe it's not necessary to make the shell and drivers conditionally include this field). The same way that users today can tack a .explain() onto an existing call to db.collection.find(blah).blah().batchSize().blah() and see an explain of the same query, users of 2.8 should be able to use the same cursor methods against an "explainable collection" and see the explain for the same query.

Generated at Thu Feb 08 03:39:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.