microsoft / microsoft/vscode-documentdb

Query Insights: Planner-tree traversal helpers miss shard branches

Open
#620 0 comments 0 reactions 0 assignees View on GitHub

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 through shards structures (matching traverseStages() behavior).
  • Extend collectPlannerStages() similarly.
  • Add a sharded test case where IXSCAN.isBitmap === true appears 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.