I'm newbie to mongodb and I need help about increasing performance for queries using compound indexes.
I am using pagination using "_id" field. Query:
db.data.find( {"$or": [ { "cat": "5" }, {"cat": "6" } ] }, {"style": "3"},
…
Consider the following scenario:
100% of the time my query will include a in the query, and sometimes also b.
90% the query will be:
{a:"somevalue"}
and 10% it will be
{a:"somevalue",b:"somevalue"}
What would be the downside to satisfy this with…
In the code below I am querying on the date and sorting by name (it can sound weird that I don't index the date field but I am doing that to avoid sorting in memory that's why I index by name).
If I am running an explain I got the following :
->…
I have created an compound index on mysql, here is the command that i use:
create index deliver_aid_sid_rcnt_idx on DELIVER_SM(AID,STATUSID,RETRY_CNT) USING BTREE;
The weird is that i got different cardinality value for each field. is that normal? i…
I have two fields in a document I want to index. One of them is Receive Time, and the other one is Serial Number. I want users to be able to query on Serial Number alone or on both Serial Number and Receive Time.
The way I see it, I have two…
I have a doubt on MongoDB sparse Index.
I have a collection (post) with very little documents (6K the biggest) that could embed a sub-document in this way:
{
"a": "a-val",
"b": "b-val",
"meta": {
"urls": [ "url1", "url2" ... ],
…
I am running a Rails App and using mongoid. I have created Account as a Mongoid::Document in my rails app.
There is large amount of records in account document, I have added compound index to fast the queries. but the performance of the application…
I have a question regarding compound indexes that i cant seem to find, or maybe just have misunderstood.
Lets say i have created a compound index {a:1, b:1, c:1}. This should make according to…
The query is
SELECT v.value
FROM products
JOIN products_attributes_options pao
ON 1 = 1
AND products.id = pao.product_id
JOIN attributes_options ao
ON 1 = 1
AND…