Understand MongoDB explain stats without reading huge JSON
Running `.explain("executionStats")` returns a giant nested JSON document. TraceMole parses execution stats automatically in real time, compiling visual summaries of documents scanned, keys examined, and index stages inside your API traces.
What TraceMole Solves
COLLSCAN Alerts
Flags full-collection scans instantly so you know when filter indexes are missing.
Scan-to-Return Ratio
Calculates totalDocsExamined/nReturned ratios and alerts when queries are wasting database cycles.
Index Suggestions
Generates ready-to-run compound index queries tailored for your specific query structures.
How TraceMole detects COLLSCANs
TraceMole monitors MongoDB client requests in real-time. By tracking driver executions and pulling explain plans for queries exceeding latency thresholds, we look at the query execution planner's stages. If the planner is forced to execute a COLLSCAN stage instead of an index-based stage, TraceMole flags the endpoint immediately and triggers a performance alert.
When to add an index
You should add an index whenever you observe queries performing linear collection scans, or when the scan-to-return ratio grows high. Enforcing index keys matching your filter parameters, sorting fields, and projection fields prevents full collection lookups. However, adding too many indexes degrades write speeds, so TraceMole targets index suggestions exactly to your active execution query shapes.