-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Index DDL paths in the catalog/storage layer (e.g. MultiIndexBlock::commit, IndexBuildBlock, IndexCatalogImpl::dropIndexEntry/refreshEntry, primary_driven::commit) currently call multiple separate query-owned functions to keep query plan cache and PathArrayness consistent with the set of the indexes.
The query-owned functions are:
- CollectionQueryInfo::rebuildIndexData (classic plan cache invalidation on index DDL and recomputes the PlanCacheIndexabilityState)
- CollectionQueryInfo::clearQueryCache (classic plan cache invalidation with shared readers; if num readers > 1 then it is same as calling the aforementioned rebuildIndexData
- CollectionQueryInfo::rebuildPathArrayness (PathArrayness invalidation on index DDL)
- join_ordering::bumpCollectionVersionForDDL (join plan cache invalidation, introduced in
SERVER-129267)
We also have 2 functions that are called in the case where a document write flips multikeyness. These need to be distinct due to the different semantics in this case (see SPM-3143 for more info)
- CollectionQueryInfo::clearQueryCacheForSetMultikey (triggered when a document write causes a flip in multikeyness of an index)
- This function needs to maintain const due to the callers IndexCatalogEntryImpl::forceSetMultikey / IndexCatalogEntryImpl::_catalogSetMultikey being const. It clears the plan cache by using pointer dereference which bypasses the const requirement
Note: This multikey flip from document write may be tricky to consoliate and could require a follow-on ticket/different API.
This leaks query implementation details into catalog/storage layers is error-prone since it is very easy to miss one function call, e.g. during refactors.
The main goal of this ticket is to consolidate these distinct calls into a single query-owned function that can be called from the catalog/storage layers while preserving the existing behavior.
- is related to
-
SERVER-129267 [Join Optimization] Ensure DDLs bump the current collectionVersion
-
- Closed
-