The Cross-Shard Join

An orders service shards orders by user_id and products by product_id. The order history page joins the two to show product names, and p99 latency has tripled as the fleet grew. What is that join really costing?

A

The two tables run at different isolation levels, so the join blocks behind locks held by product writes

B

The rows it needs live on product shards the user's shard does not hold, so one page becomes a scatter-gather

C

The join column is unindexed, so each participating shard falls back to a sequential scan of products

D

Joins are inherently slower once sharded, because the planner loses access to table statistics