Visual Explain โ read plans at a glance
Color-coded stage cards, cost ratio chips, and per-stage glyphs so the worst stage of a plan jumps out without reading JSON.
What it shows
Every aggregation/find plan renders as a tree of stage cards. Each card carries 4 visual signals: a colored 4px accent bar on the left (good/warn/bad grade), a glyph identifying the stage type (Key icon for IXSCAN, Warning for COLLSCAN, SortAscending for SORT, etc.), a chip with examined/returned ratio when docsExamined is available, and an index name chip for IXSCAN-family stages.
How to open it
- Open any workspace tab on a collection (Documents, Aggregation, etc.).
- Type your query in the Query Bar or build a pipeline in the Aggregation builder.
- Click "Explain" (top-right). The plan opens as a tree.
- Hover any cost-ratio chip to see WHY that stage got its grade (full collection scan, low selectivity, dominant time share, etc.).
Cost grades
NoSqlStudio grades each stage as good (efficient), warn (likely wasteful), or bad (definitely wrong) โ applied in priority order, first match wins:
| Color | Meaning | Trigger |
|---|---|---|
| ๐ข Green | Efficient stage | IXSCAN / EXPRESS_IXSCAN / IDHACK / FETCH |
| ๐ก Yellow | Likely wasteful โ review | Small COLLSCAN, in-memory SORT, low index selectivity (<10%), stage dominates >30% of total time |
| ๐ด Red | Definitely wrong โ fix before shipping | COLLSCAN over >1000 docs, in-memory SORT exceeding 32MB threshold |
Reading the cost ratio chip
The chip shows "examined โ returned ยท X%" โ the percentage of examined docs that actually came back. Rule of thumb:
- > 50%: index is well-shaped for this query.
- 10โ50%: borderline โ might be acceptable for ad-hoc queries; rebuild index for hot paths.
- < 10% with examined > 100: warn โ index is the wrong shape (compound index missing, wrong sort order, etc.).
Worked example
Run this query against a 1M-doc orders collection that has no compound index:
db.orders.find({ status: 'paid', userId: ObjectId('...') })You will see a red COLLSCAN card at the bottom of the plan ("Full collection scan over >1000 documents โ likely missing an index"). Create a compound index on { status: 1, userId: 1 } and re-run โ the plan now shows a green IXSCAN with a 99% cost ratio.