0

We have multiple fields to be indexed:

field1, field2, field3, field4, field5

We know that users will query data only using the next combinations:

field1, field2, field3
field1, field2, field4
field1, field4, field5
field3, field4, field5

No other quering combinations will be performed. All indices will have the same amount of documents (doesn't matter if they are 4 separate indices or a single index).

Which solution has less data overhead, index time overhead and faster quering time? Would it be better to create 4 different indices in this case or a single index containing all 5 fields?

My intuition tells me that having 4 indices will be better because they will have less fields to index which will probably improve both indexing and query performance but it's not clear what overhead brings one or another solution. Could be that using 4 indices will take up more space because of duplicate fields stored in multiple indices or could be that a single index takes up more space because it could potentially require to store more indexing combinations. That said, my intuition could be wrong.

Oleksandr
  • 3,574
  • 8
  • 41
  • 78
  • For so few fields, definitely single index, but it also depends on the overall volume of data. – Val Oct 18 '22 at 17:33

0 Answers0