MongoDB Index
Indexes can usually greatly improve query efficiency. Without an index, MongoDB must scan each file in the collection when reading data and select those records that meet the query conditions.
The query efficiency of scanning the entire collection is very low. Especially when processing a large amount of data, the query can take dozens of seconds or even minutes, which is very fatal to the performance of the website.
给我你的怀抱2017-05-02 09:27:14
Let’s search on Baidu. There are many documents. MongoDB's index is mainly a B-Tree index, and the principle of the B-Tree index of most databases is the same.