Before multiplanning, the canonical queries eligible for DISTINCT_SCAN were treated separately, and a projection (generally, with the distinct key) is set by default. For the fallback find the projection was eliminated. Now, since we are multiplanning both IXSCANs and DISTINCT_SCANs are under the same canonical query, and we no longer need to add a projection.
- is depended on by
-
SERVER-94155 Re-enable index pruning for distinct scan
- Open
-
SERVER-94087 Avoid using a PROJECTION_COVERED stage with DISTINCT_SCAN
- Open
- related to
-
SERVER-14832 Distinct command result set may include or exclude null/undefined depending on presence of index
- Needs Scheduling
-
SERVER-83620 DISTINCT_SCAN produces incorrect results for nested arrays
- Open
-
SERVER-25803 Covered distinct plans do not need a PROJECTION stage
- Backlog