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, Cost-based ranker plan selection for sorted queries (8.3+), ESR guideline and $in placement in compound indexes, Interval evaluation trees and parameterized plan caching, Multikey indexes and index-provided sort order, Multikey indexes and sort provision (multikeyPaths), Multiplanner scoring and tie-breakers, Plan cache key and $in length (classic vs SBE), Rooted $or subplanning and SORT_MERGE, SBE plan cache keys and parameterized explode-for-sort plans, explodeForSort integer overflow (CVE-2026-82076), internalQueryMaxScansToExplode and maxScansToExplodeReached

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