T
T
terkin2013-07-10 19:13:35
NoSQL
terkin, 2013-07-10 19:13:35

What is faster search by one parameter or by several?

The question is, what will be faster search by hash, or by several parameters, I will try to explain:
{ "_id": ObjectId("51dc52c13e6fc0101e00006a"), "hash": "mdsf74y473993gdfdgdfgdfgd333", "feature_id": "164", "product_id": "40558", "feature_type": "E", "data": {.... }

which search will be faster - if you pass only hash, or several parameters
ps I suspect that by hash, but I would like to know for sure

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Poludnenko, 2013-07-14
@uaoleg

The fastest way is to make a selection on several indexed fields. You can read about how to do it right here , here and there .

A
Alexander, 2013-09-02
@akalend

make a composite index, moreover, first there must be the names of the fields, the value of which is returned by the largest amount of data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question