mongodb - What does nscannedObjects = 0 actually mean? -
as far understood, nscannedobjects entry in explain() method means number of documents mongodb needed go find in disk.
my question is: when value 0, mean besides explanation above? mongodb keep cache documents stored there?
mongo document database, means can interpret structure of stored documents (unlike example key-value stores).
one particular advantage of approach can build indices on documents in database.
index data structure (usually variant of b-tree), allows fast searching of documents basing on of attributes (for example id
(!= _id)
or other distinctive feature). these stored in memory, allowing fast access them.
when search documents basing on indexed attributes (let's id
> 50), mongo doesn't need fetch document memory/disk/whatever - can see documents match criteria basing solely on index (note fetching disk several orders of magnitude slower memory lookup, no cache). time goes disk when need fetch document further processing (and not covered statistic cited).
indices crucial achieve high performance, have drawbacks (for example used index can slow down inserts , not worth - after each insertion index has updated).
Comments
Post a Comment