SORT_MERGE and $in sort expansion

Published reference · snapshot 2026-10-20 · skill mongodb-expert/references/sort-merge-and-in-sort-expansion.md

Also known as: $in expansion and SORT_MERGE, Planner bound unionizing and large $in lists, SORT_MERGE and sorted index unions

↓ Facts as markdownall context files

Source-anchored research for SORT_MERGE and $in sort expansion. Run status: COMPLETED.

These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.

Definitions

Structure and components

How it works

How-to and procedures

Problems, failure modes and limitations

Comparisons and alternatives

Facts and statements

Children

Frontier under this node: Blocking sort memory limit and allowDiskUse (4.25), Cost-based ranker plan selection for sorted queries (8.3+) (3.40), ESR guideline and $in placement in compound indexes (4.05), Multikey indexes and index-provided sort order (4.17), Multikey indexes and sort provision (multikeyPaths) (4.17), Plan cache key and $in length (classic vs SBE) (4.10), Rooted $or subplanning and SORT_MERGE (3.73), SBE plan cache keys and parameterized explode-for-sort plans (3.60), explodeForSort integer overflow (CVE-2026-82076) (3.58), internalQueryMaxScansToExplode and maxScansToExplodeReached (3.52)

← the whole tree · 3D view· how to read this page