-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In the detailed join explain output, change each ndvEstimates entry to:
{
ndvs: [ { nss: 'shop.suppliers', ndv: 3, ndvSource: 'Sampling' } ],
joinPredicateSelectivity: 0.3333333333333333
}
- ndvs lists the NDV estimate of every side that was estimated: the smaller collection's side always, and the other side when it is available without sampling (unique index or persisted NDV statistics). It replaces assumedPkSide/ndv/ndvSource, which only show the larger of the two.
- Rename selectivity to joinPredicateSelectivity (= 1 / max(ndv)).
joinPredicateSel in cardinality_estimator.cpp already computes both sides; JoinEdgeSelectivityEstimate needs to keep them and JoinExtraEstimateInfo::serialize needs to output them.
- is depended on by
-
SERVER-138709 Document join optimizer explain output
-
- Open
-