[SERVER-68483] Use multikey metadata for more precise array estimation Created: 02/Aug/22  Updated: 05/Dec/22  Resolved: 15/Sep/22

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

Type: Task Priority: Major - P3
Reporter: Timour Katchaounov Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: M4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-69591 [CQF] Simplify non-sargable paths Closed
Related
related to SERVER-69591 [CQF] Simplify non-sargable paths Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

The optimizer collects metadata about path multikeyness (whether a path contains arrays).

This metadata is available via the method ScanDefinition::getNonMultiKeyPathSet() that returns all paths that do NOT contain arrays.

This task should use this metadata to improve cardinality estimation in the cases when such metadata is available. This metadata has priority over statistics - that is, if statistics says there are arrays, but the metadata says there aren't, we trust the metadata. Normally this shouldn't happen.

We can also use this information for heuristic estimation, for instance a query that uses an array comparison value will return 0 matches if there are no arrays.



 Comments   
Comment by Timour Katchaounov [ 15/Sep/22 ]

This task won't be needed since SERVER-69591 will remove traverses over non-multikey paths.

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