[DOCS-12781] [Server] Document that explain neither reads from nor writes to the plan cache Created: 06/Jun/19  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, feature, query, reopened, server-docs-bug-bash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-40844 Better tie breaking of "perfect" indexes Closed
Participants:
Days since reply: 1 year, 14 weeks ago

 Description   

Description

When users run an explain of any command (find, aggregate, update, etc.), the plan cache is not used. Instead, the set of candidate plans are generated and a winner chosen without ever consulting the plan cache as described here: https://docs.mongodb.com/manual/core/query-plans/. Furthermore, no plan cache entry is created for the winning plan. We should document this behavior.

This is a common source of user questions and confusion, because when a cache entry is present it can cause users to observe a discrepancy in the plans selected by explain and the plans selected without explain. SERVER-16895 is an open request to allow users to run explain in a mode which read a plan out of the plan cache, but this improvement is not currently scheduled for development.

Scope of changes

 



 Comments   
Comment by Sarah Olson [ 02/Nov/22 ]

Thanks david.storch@mongodb.com! Appreciate the confirmation. 

Comment by David Storch [ 02/Nov/22 ]

sarah.olson@mongodb.com ashley.brown@mongodb.com I'm re-opening this issue. It still seems relevant. The fact that explain does not use the plan cache can sometimes be relevant when debugging query performance, so it seems worth extending the docs to mention this at some point.

Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 08:06:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.