Cross-bucket indexing

Hi @kivey,

When you JOIN two buckets, for example:

FROM ORDERS o INNER JOIN CUSTOMER c ON KEYS o.cid
WHERE o.zip = 58238;

In couchbase JOINS, we use indexes on the leading bucket (keyspace).
In this case, the index will be used on ORDERS for the predicate (o.zip = 58238).
As the index streams the qualified document IDs, N1QL engines does a KV GET on the CUSTOMER – no further index required.