[SERVER-75678] Consider adding a plan cache serverStatus counter for queries which are not eligible for caching Created: 05/Apr/23  Updated: 19/Jan/24  Resolved: 19/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Anton Korshunov Assignee: Carlos Alonso Pérez
Resolution: Done Votes: 0
Labels: neweng, query-director-triage, query-product-scope-1, query-product-urgency-3, query-product-value-2, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by COMPASS-7587 Investigate changes in SERVER-75678: ... Closed
Documented
is documented by DOCS-16595 [SERVER] Investigate changes in SERVE... Closed
Duplicate
is duplicated by SERVER-83509 idhack queries are incorrectly counte... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2024-01-22
Participants:

 Description   

This is a follow up ticket from SERVER-70025.

Currently we only count cache plan cache hits and misses, regardless of the query type. That is, we expect a plan for the given query to be in the cache, and as such can be recovered from the cache, or missed from the cache, and needs to be replanned.

However, there is a difference between "didn't use cache because there wasn't a cache entry" and "didn't use cache because this query is ineligible for caching". 

We may want to consider adding a third counter (in additional to "hits" and "misses") to account for this difference. 



 Comments   
Comment by Githook User [ 18/Jan/24 ]

Author:

{'name': 'Carlos Alonso', 'email': 'calonso@users.noreply.github.com', 'username': 'calonso'}

Message: SERVER-75678 Differentiate cache miss from not using cache (#18068)

GitOrigin-RevId: e925b31178c02716f0959103ccec937f87294401
Branch: master
https://github.com/mongodb/mongo/commit/3d7701edd3b62a65ae8468ccea2f54fac5fc97a3

Comment by David Storch [ 28/Nov/23 ]

Putting this back in the triage queue. Per my discussion with anton.korshunov@mongodb.com, this seems like a worthwhile improvement in order to avoid the confusion described by SERVER-83509. Currently, the fact that queries which are ineligible for caching are counted as plan cache misses is misleading. This ticket would fix the problem by no longer counting such queries (in particular, idhack queries) as plan cache misses and instead counting them as their own category. Importantly, this change wouldn't simply add a new serverStatus() counter, it would also make sure that the counters for SBE and classic plan cache misses are never incremented for queries that would never consult the plan cache in the first place.

Comment by Ana Meza [ 18/Apr/23 ]

Passing to Product-Triage to identify priority

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