Indexes on sharded collection

Hi @Nithin_Kumar ,

Well it depands on the nature of the queries and what is the optimal index to support them.

However, if you don’t include the tenantId prefix in your queries and your compound index prefix you will probably end up with a scatter gather (distrebuted) query that will essentially send the query to all of the shards and wait until all of them respond :

This can be a performance problem and you should avoid it if possible…

Thanks
Pavel

1 Like