microsoft / microsoft/vscode-documentdb
Query Insights: Planner-tree traversal helpers miss shard branches
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 22
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 21
Description
Summary
findStageInPlan() in ExplainPlanAnalyzer.ts and collectPlannerStages() in StagePropertyExtractor.ts only traverse inputStage and inputStages — they do not recurse through shards structures. In contrast, traverseStages() (execution-stage traversal for UI) already handles shards.
This means for sharded DocumentDB clusters, planner-stage signals like isBitmap can be missed when they appear under a shard branch. Only Stage 2 informational badges (bitmap, low-cardinality) are affected — Stage 3 (AI) receives the raw explain JSON and is unaffected.
What needs to change
- Extend
findStageInPlan()to recurse throughshardsstructures (matchingtraverseStages()behavior). - Extend
collectPlannerStages()similarly. - Add a sharded test case where
IXSCAN.isBitmap === trueappears under a shard branch.
Related
- #522 — Query Insights: Improve with Explain Schema — should be tackled together, as formalizing the explain schema will inform how shard traversal should be structured.
Origin
Identified during review of PR #616 (R-002 in docs/analysis/pr-616-review.md). Severity: Low.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ExplainPlanAnalyzer.ts and StagePropertyExtractor.ts, then compare their traversal logic with traverseStages(), which already handles shard branches. Add a sharded test case where IXSCAN.isBitmap is true under a shard branch, and verify that planner-stage signals and Stage 2 informational badges are detected there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100