Cross-database sharding consistency

is data sharded consistently across databases with the same number of partitions on the same number of nodes such that a query would result in local join operations, or is sharding consistency only guaranteed within the same database? For example, suppose that database A has table X with shard key K and database B has table Y with the same shard key K, then I join them with the following query.

SELECT *
FROM A.X
INNER JOIN B.Y
ON Y.K = X.K;

The sharding will not match up in general because the corresponding partitions of the different databases can live on different nodes. So there isn’t a way to do local join operations across databases.

1 Like