Skip to content

Commit eb82fb3

Browse files
committed
TMP: Enhance performance investigation documentation with MongoDB query analysis and benchmarking targets
1 parent cd37c87 commit eb82fb3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/Performance-Investigation.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,20 @@ Why this matters:
126126
- Bucket-qualified reads use the primary checkpoint index; all-buckets reads may bypass it.
127127
- Small performance cost, but measurable for high-volume checkpoint polling.
128128

129+
MongoDB explain check on the current query shape:
130+
131+
- `GetFrom(Int64 checkpointToken)` and `GetFromTo(long fromCheckpointToken, long toCheckpointToken)` both plan as `FETCH + IXSCAN`.
132+
- The winning index for the all-buckets query is `_id_`, not `GetFrom_Checkpoint_Index`.
133+
- That means this is **not** a COLLSCAN regression, and it is also **not** a missing-index problem.
134+
- The gap is the negative filter shape preventing MongoDB from using the bucket-qualified checkpoint index.
135+
- An explicit inclusion rewrite (`BucketId in [active buckets]`) did not change the winning plan in the checked data shape; MongoDB still chose `_id_`.
136+
- A dedicated partial `_id` index is not a viable shortcut here because MongoDB rejects `partialFilterExpression` on `_id`.
137+
129138
What needs benchmarking first:
130139

131140
- Bucket-qualified vs all-buckets checkpoint reads (already in benchmark suite).
132141
- Index explain() plan comparison between the two approaches.
142+
- If this remains worth pursuing, test a query rewrite that actually changes scan order, not just the bucket predicate form.
133143

134144
### 4. Default checkpoint generation adds a database read per commit
135145

0 commit comments

Comments
 (0)