Query Execution


Thank you in advance to reply on this post.

We are using couchbase community edition. In order to leverage index on community edition we have created same index for same columns with different name on other nodes as on community the index is not replicated across nodes.

So on community edition when we create index does it built indices for data available on that node or does it account for all nodes ?.

And if the index account for all data nodes when an query picks the index we see one node is returning faster and where as the other node is taking time with more CPU cycles.

There is no replication of Indexes in CE. But you can create separate indexes with same columns with different name and it called equivalent index. Each one is built its own but during execution it detects those are all same and does load balancing.

The index is global index. Each index include all the data from all the nodes.

Thank you appreciate your input but are we sure during execution plan the optimizer makes two index though its different name for same column and treat them as one ?. Does the explain plan will show those behavior ?

Will you be able to guide me in pointing out the document which I can refer regarding this topic.

https://blog.couchbase.com/create-right-index-get-right-performance/ Check Rule #3


So for community edition though we are on 5.0 version we will not be able to use index replica clause because its enterprise only feature.

Index replica is EE only. You can create equivalent indexes (same definition expect different name, created manually) in CE. Single query uses one index only, but same queries can use different indexes and do load balancing.