[Improv.] improve schema for current mongodb storage , especially for category indexing
Closed this issue · 3 comments
The category field in the current schema is storing an array of values.
"categories" : [ "semantic web", "wireless", "web services", "internet" ],
This cannot be indexed as these are not unique across each entry in the database. We have some queries that specifically require to get entries corresponding to one category. Like
query: get all conference of category "wireless"
For such query, the complexity will rise to O(n) for the database. We need a solution to this problem.
Update: The array fields can be indexed through multi indexing.
Multikey indexing
Bounds of multi key indexing
Bounds ||
The documents can be indexed on the array fields for now. especially is the search criteria is only one entry from the array. Which allows for faster results (fist entry is used for index based filtering) . Currently we can resort to some sort of in memory caching to reduce response times and DB calls.
@rajatkb I would like to work on this issue. Please assign this to me as part of GSSoC'20.
The issue is resolved for now. But if you see any improvements can be done in the queries and indexed fields. You can put a PR.