Why Queries Get Slow, and What an Index Is

A query with no index reads every document in the collection, which is fine for 50 orders and slow for 100,000, while an index keeps one field's values in order so MongoDB can go straight to the matches, at a cost in disk space and in every write.

By

Updated

Cheat sheet: Why Queries Get Slow, and What an Index Is
Category
MongoDB
Level
Apprentice
Tags
Collection Scan, createIndex, database, Index in MongoDB, Index Scan, mongodb