Collection scan on sessions (user_id, last_active)
db.sessions.find({ user_id }).sort({ last_active: -1 })db.sessions.createIndex(
{ user_id: 1, last_active: -1 },
{ background: true }
);MongoDBMongoDB performance monitoring & query optimization
TrueBridging watches query shapes, replication lag, and connection load across your MongoDB deployment, and turns collection scans into indexed, verified fixes.
Collection scan on sessions (user_id, last_active)
db.sessions.find({ user_id }).sort({ last_active: -1 })db.sessions.createIndex(
{ user_id: 1, last_active: -1 },
{ background: true }
);Why MongoDB needs purpose-built monitoring
MongoDB's flexible schema is a feature for developers and a trap for performance. A query shape that worked fine against a small collection can quietly become a full collection scan as documents accumulate, because there was never a schema migration step to force an index conversation. Add replica sets, sharding, and connection pooling on top, and the failure modes multiply: replication lag that silently serves stale reads, an oplog window too short for a delayed secondary to catch back up, or a connection pool that saturates under a traffic spike.
TrueBridging monitors MongoDB the way it's actually run in production — as a replicated, often sharded system where the biggest risks are invisible until a query shape or a topology change tips things over.
What TrueBridging watches
Detects COLLSCAN-driven queries from real production traffic and groups them by shape to prioritize the highest-impact index opportunities.
Tracks replication lag per secondary and oplog window size, flagging configurations at risk of a secondary falling out of sync.
Monitors active connections against configured limits, per-driver pool sizing, and connection churn patterns.
Estimates working set size against available RAM and flags collections at risk of page-cache eviction thrashing.
Surfaces uneven chunk distribution and jumbo chunks that concentrate load on a single shard.
Aggregates slow operations by shape and origin service, so you know which application code path to fix, not just which query.
Example
A sessions collection query filtering on user_id and sorting by last_active has no supporting compound index, forcing a collection scan on every call. TrueBridging flags the shape as responsible for a growing share of total database load and proposes:
Once approved, TrueBridging builds the index in the background, confirms the query planner is now selecting an IXSCAN instead of a COLLSCAN, and verifies the improvement in observed p95 latency before closing the issue.
db.sessions.createIndex(
{ user_id: 1, last_active: -1 },
{ background: true }
);FAQ
TrueBridging can work with the database profiler enabled at a sampled level, or rely on serverStatus, currentOp, and slow-query log entries where the profiler is kept off in performance-sensitive production clusters.
Yes. TrueBridging monitors replica set member health, oplog window, and replication lag, as well as per-shard load distribution and chunk balance in sharded clusters.
Yes. TrueBridging identifies collection scans (COLLSCAN) driven by real production query shapes and proposes the specific compound index that would convert them into index scans.
Yes. TrueBridging connects to self-hosted MongoDB as well as MongoDB Atlas clusters using a read-only database user.