The router knows that some tables have been split into shards. If possible, the router tries to determine on the first transaction statement to which shard this transaction should be sent.SPQR supports both single-column and composite (multi-column) sharding keys.
When a query arrives, the router extracts the sharding key from the query and determines which key range (and thus which shard) should handle it.
Copy
-- This query works with properly configured sharding rules-- The router extracts id=10 and routes to the appropriate shardINSERT INTO test(id, age) VALUES (10, 16);