0

There are over 30 different filters It can be an exact value, a selection from values, or ranges of values. Various combinations are possible, i.e. there are more than several hundred possible combinations of filters

How, then, should the indexes be composed correctly? Does it make sense to make an index on each field?

Count works insanely slow in this case.

prasad_
  • 12,755
  • 2
  • 24
  • 36
Dima
  • 1
  • See the types of indexes that can be used for query optimization: [MongoDB Indexes](https://docs.mongodb.com/manual/indexes/). – prasad_ Apr 08 '21 at 03:16
  • You will need to show some code / JSON. The number of combinations is irrelevant. What are the fields, how many, what type, and what do the queries look like? – Ian Mercer Apr 08 '21 at 03:47
  • See https://stackoverflow.com/questions/62263023/what-is-the-correct-way-to-index-in-mongodb-when-big-combination-of-fields-exist/62268015#62268015 – D. SM Apr 08 '21 at 04:00

0 Answers0