I had the opportunity to use mongoDB in my app I measured the performance
From the conclusion A DB without an index is too slow to be useful </ b>
The execution environment is as follows
name | spec |
---|---|
OS | Ubuntu18.04 |
CPU | Virtual 6 core |
memory | 24GB |
HDD | 7200rpm(Equivalent to 100 IOPS) |
See below for IOPS https://qiita.com/you21979@github/items/21c125a6359d55e9dec4
Insert_one is one by one, insert_many is 1 million items at once The rest is the difference between indexed and unindexed
There was a big difference in speed in the insertion method, There was no big difference with or without the index
Since there was only one index earlier Try changing with 0, 1, 10, 25, 50
As the dogma, the larger the index, the slower it becomes. By the way, in this case, the maximum number of indexes was 61. (No more errors)
After all, it was a comparison with only indexes The difference between the two is that find_one has one document find just returns the cursor (iterator)
Recommended Posts