I don’t know if there is no optimization in the index village. There is no in-depth understanding of indexes. Please help explain it by the way!
1. Each piece of data has geographical information. (province, city), then I created an index:
db.v.createIndex({city:1}
db.v.createIndex({area:1}
My doubt is, when this is created, is there no piece of data to create an index value or is it created based on the index value?
比如存在这样的数据
id name city area
1 zhangsan beijing beijing
2 lisi shanghai shanghai
3 zhaowu beijing beijing
#每条数据建立
city->beijing->1
city->shanghai -> 2
city->beijing->3
#还是根据索引值
city->beijing--|-> 1
|-> 3
city->shanghai->2
Thanks
I don’t fully understand your question. My general understanding is:
1. Most of MongoDB’s indexes are B Tree indexes; in addition,
2. B Tree is sorted and saved according to the index value, and points to the storage location of the corresponding Collection.
3. To extend a bit, the current underlying WiredTiger of MongoDB uses a Log-Merged Structure Tree to optimize writing performance.
You can learn more about MongoDB’s indexes above. for reference.
Love MongoDB! Have fun!
I don’t quite understand your question, but here are some suggestions on using MongoDB to create indexes. You can refer to:
http://forum.foxera.com/mongo...