From b4c5500fa1c658d89d6cf3e1f504f63956892c0b Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Thu, 7 Mar 2019 13:33:03 +0200 Subject: [PATCH] MXS-2362 Document SchemaRouter table-sharding limitations --- Documentation/Routers/SchemaRouter.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Documentation/Routers/SchemaRouter.md b/Documentation/Routers/SchemaRouter.md index 45da5b2d3..3e5ac3ca1 100644 --- a/Documentation/Routers/SchemaRouter.md +++ b/Documentation/Routers/SchemaRouter.md @@ -139,24 +139,20 @@ refresh_interval=60 This functionality was introduced in 2.3.0. -If the same database exists on multiple servers, but the database contains -different tables in each server, the SchemaRouter is capable of -transparently routing queries to the right server, depending on which table -is being addressed. +If the same database exists on multiple servers, but the database contains different +tables in each server, SchemaRouter is capable of routing queries to the right server, +depending on which table is being addressed. -For instance, suppose the database `db` exists on servers _server1_ and -_server2_, but that the database on _server1_ contains the table `tbl1` and -on _server2_ contains the table `tbl2`. - -In that case, the query +As an example, suppose the database `db` exists on servers _server1_ and _server2_, but +that the database on _server1_ contains the table `tbl1` and on _server2_ contains the +table `tbl2`. The query `SELECT * FROM db.tbl1` will be routed to _server1_ and the query +`SELECT * FROM db.tbl2` will be routed to _server2_. As in the example queries, the table +names must be qualified with the database names for table-level sharding to work. +Specifically, the query series below is not supported. ``` -SELECT * FROM db.tbl1 +USE db; +SELECT * FROM tbl1; // May be routed to an incorrect backend if using table sharding. ``` -will be routed to _server1_ and the query -``` -SELECT * FROM db.tbl2 -``` -will be routed to _server2_. ## Router Options