Let us suppose we have the next data structure:
{
{
"name" : "ElementName1",
"index" : [
{"name" : "key1", "value" : 1},
{"name" : "key2", "value" : 2},
{"name" : "key3", "value" : 3}
]
},
{
"name" : "ElementName2",
"index" : [
{"name" : "key1", "value" : 3},
{"name" : "key2", "value" : 2},
{"name" : "key3", "value" : 7}
]
},
}
The idea is to have the best read performance possible. Let us suppose the priority on searching by name, so we ensure an ascending index on name (actually I've written a prototype and index considerably increases the search speed. This decreases the time for search from 1-2 sec to 0,1 sec for a million of really large documents.) The idea is to index the nested array fields somehow, but the problem is from what they write here, it is somehow impossible. I am trying to implement it using mongodb-csharp combination, but I suggest we do not specify the language. What are the possible increase options as I see:
- Implement this index in a way I am not yet aware of.
- Create one more collection for those array nested fields and index it in there.
- Other options.
Please sha开发者_开发百科re your view and ideas.
精彩评论