Tagged Questions
0
votes
0answers
31 views
The best approach to index dynamic query in MongoDB
I am working on log managment system where user will be able to upload logs from file. I have 'event' collection where I store all events from all sources (each source can have different log format ...
1
vote
2answers
155 views
Mongodb multikey index and $all in queries
I have such structure of documents in my products collection:
{
title: 'Samsung Galaxy S III',
category_id: ObjectId("50bcc2f0b910a6c1936a4424"),
properties: [
{
title: 'OS',
...
0
votes
1answer
53 views
Why $in is much faster then $all
I am well aware of what those 2 do. $in take .3 seconds. And $all take 26 seconds. Huge different. If anything $in should take longer because it returns more data.
Also if the limit is removed, $in ...
0
votes
0answers
139 views
Why this query takes 500 seconds to complete even though I got all the compound index right?
I tried this query
db.tablebusiness.find({ "LongitudeLatitude" : { "$nearSphere" : [106.772835, -6.186753], "$maxDistance" : 0.053980478460939611 }, "Prominent" : { "$gte" : 15 }, "indexContents" : { ...
1
vote
1answer
163 views
How to interpret this “db.explain()” for this mongodb query
db.tablebusiness.find({ "LongitudeLatitude" : { "$within" : { "$centerSphere" : [[106.772835, -6.186753], 0.0089967464101566] } }, "indexContents" : { "$all" : ["warung"] }, "Prominent" : { "$gte" : ...
0
votes
1answer
115 views
The sort column must be the last column used in the index - MongoDB Indexing Advice
MongoDB docs advices that:
The sort column must be the last column used in the index
Here is the example:
db.foo.ensureIndex({a: 1, b: 1, c: 1})
Good:
find(a=1).sort(a)
find(a=1).sort(b)
...
4
votes
1answer
343 views
How to index dynamic attributes in MongoDB
I have following kind of data (simplified a bit from my real case) in MongoDB:
{
"name":"some name",
"attrs":[
{"n":"subject","v":"Some subject"},
{"n":"description","v":"Some ...
10
votes
1answer
839 views
How do databases store index key values (on-disk) for variable length fields?
Context
This question pertains to the low-level implementation details of indexes in both SQL and NoSQL database systems. Actual structure of the index (B+ tree, hash, SSTable, etc.) is irrelevant as ...