Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Too many indexes in RavenDB

Is there a formula/estimation/feeling that shows us what is the optimum number of indexes in a RavenDB database according to number of document kinds, number of fields per document and number of relations between them?

Additional notes:

As I understand (1st) we query indexes in RavenDB, not documents and (2nd) indexes are like materialized views, so they can cost much. I need to know how many indexes would hurt RavenDB's performance in updating them and make latency too big to ignore?

As Raven/MaxNumberOfParallelIndexTasks is set to the number of processors in the current machine, so does it mean the indexing process for other indexes would block until current indexing tasks end? Or they are partial updates that would run again and again?

like image 264
Kaveh Shahbazian Avatar asked Jun 26 '12 05:06

Kaveh Shahbazian


1 Answers

Kaveh, In general, we prefer smaller number of indexes, because indexes do have non trivial cost associated with them. That said, they do not cost much, especially since they are being built in the background.

We have many customers that run with several dozen indexes, and we have a few that run with a few hundreds.

The MaxNumberOfParallelIndexTasks control how many indexes we update in parallel, but how and why it works is a bit complex to explain. From your point of view, it doesn't really apply, because along with MaxNumberOfParallelIndexTasks, we also take into account things like current system load, io costs, etc. In large number of indexes, some indexes would wait while other are building, yes, but that is subject to a set of limits, and you aren't likely to be able to see this as a problem in real world situations.

like image 106
Ayende Rahien Avatar answered Sep 29 '22 23:09

Ayende Rahien