report: audit and validate MongoDB optimizations - #20
Draft
carsontung666 wants to merge 15 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bench/db/report/report.tex/report.pdfas the canonical database reportoptimization.texas superseded working material, not a second final reportReview decisions
CountStage -> CountScan: narrow source candidate on a pinned master snapshotNo MongoDB optimization in the report is currently integrated into ConDB's public storage path.
MongoDB source candidate
5d3b36cf3871846fe7894616e964cb520c11d473696f0d5d30f9carsontung666/mongo:agent/condb-query-hotpathThe candidate activates a private resultless protocol only for a direct
CountStage -> CountScanedge with!_shouldDedup. PublicCountScan::work()retains validRID_AND_OBJoutput. Multikey and scalar compound-wildcard scans continue to materialize and deduplicate. Both entry points sharePlanStage::trackWork()accounting.The report claims only that the direct path avoids per-match WorkingSet-member materialization/lifecycle; it does not claim a zero-allocation query.
Historical redundancy audit
The candidate was checked against MongoDB PR #635, PR #1369, and ancestor commits
d71566a55e,dac2f722f8,d8ee635331,09b89f0986, and8f52dfc863. Those cover count planning/bounds, shard-filter elision, the valid public WorkingSet contract, cheaperRID_AND_OBJoutput, centralized work accounting, and compound-wildcard deduplication.No equivalent private direct resultless handoff was found in the inspected GitHub PRs or pinned-snapshot ancestry. This is not an exhaustive claim about private Jira work or unpublished branches.
Frozen 400K activation A/B
This is an activation ablation within the final candidate, not a whole-patch comparison against pristine upstream. Both arms contain the shared implementation and benchmark harness; the control removes only the six-line activation block. A pristine-base arm with a neutral harness remains an adoption gate.
The protocol was committed and pushed as
00fd8debefore execution:COUNT -> COUNT_SCANpreflightResults:
All 20 pairs favor activation on all three metrics; both order strata and all leave-one-pair-out estimates retain the direction.
Validation
mongod,mongos,mongo,dbtest,count_query_bmdbtestbuildquery_stage_count_scanandquery_stage_countpass under both buildslatexmk -pdf -interaction=nonstopmode -halt-on-error report.tex: 10-page PDF, no warnings, overflow, unresolved references, or errorsSHA256SUMSentry passes andanalyze.pyreproducessummary.jsonbyte-for-byteReport-entry counts include fixture and hook events. These checks are targeted, not a full MongoDB Evergreen or production qualification.
Evidence
Canonical bundle:
bench/db/report/evidence/mongodb_master_countscan_20260805_696f0d5d30f9/187c3c5768b66c33f43533b7903d572bc96179ae9160181e4275e00987d9348b420e7a6c148b2a2339984012cbbc28a344486f90a3328bcf2fb83f20248d47395a907c3a98b0b075fc2004d9269187e565d4e0394a495dc111c7b6f79e0201e3The older
mongodb_master_countscan_20260805/campaign is retained unchanged and explicitly marked superseded. Large storage-harness raw JSON underbench/db/runsremains gitignored and still needs separate publication for full external reproduction.Scope
The source result covers one pinned host and one warmed in-process scalar-count shape. It does not establish improvement for stock upstream, MongoDB 7.0.34, SBE, indirect or deduplicating plans, server-process/remote-client operation, cold or cache-constrained data, concurrency, any timed ConDB endpoint, or production latency.