0

In this question I have asked about modulus calculation in sharded tables, this design is used:

CREATE TABLE Orders (order_id INT PRIMARY KEY, ...);
CREATE TABLE LineItems (order_id INT, lineitem_id INT, PRIMARY KEY (order_id, lineitem_id), ...);

I would like to perform an INNER JOIN query so that the whole result set is gathered from a single shard in MySQL Cluster (or, for that matter, a sharded database), like so:

SELECT * from Orders INNER JOIN LineItems on Orders.order_id = LineItems.order_id where order_id <some_id>;

The idea would be that this query hit only a specific shard. Is that how a sharded database works? What needs to happen in order for that to be true?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.