indexed_lookupQuery leveraged a database index
The query pattern and performance characteristics suggest efficient index usage, enabling fast data retrieval without full scans.
Verifying index usage
typescript
// MongoDB — confirm with explain()
const result = await User.findOne({ email: 'user@example.com' })
.explain('executionStats');
console.log(result.executionStats.executionStages.stage);
// IXSCAN = index used ✓
// COLLSCAN = no index — add one
// PostgreSQL — confirm with EXPLAIN
// EXPLAIN SELECT * FROM users WHERE email = 'user@example.com';
// Index Scan using idx_users_email ✓
// Seq Scan = no index — add one
// Create indexes
await User.collection.createIndex({ email: 1 }, { unique: true });
// CREATE INDEX CONCURRENTLY idx_users_email ON users(email);