|
Discussion from Slack:
I do agree fetching the collection at that layer feels off. I think we have two potential options in the short term:
- Pass the Collection& into all these top-level methods and thread it through, rather than the opCtx.
- Keep some pointer to the relevant collection stats alongside the ExecutionStats for the collection, which I think would only require threading the collection instance through a few top-level calls (maybe just tryInsert/insert?) to be able to initialize the pointer the first time we deal with a given namespace. (Preferred implementation)
|