diff --git a/content/en/docs/24.0/reference/compatibility/mysql-compatibility.md b/content/en/docs/24.0/reference/compatibility/mysql-compatibility.md index ace366743..901966adc 100644 --- a/content/en/docs/24.0/reference/compatibility/mysql-compatibility.md +++ b/content/en/docs/24.0/reference/compatibility/mysql-compatibility.md @@ -112,6 +112,30 @@ Vitess allows selecting a keyspace (and shard/tablet-type) using the MySQL `USE` USE `mykeyspace:-80@rdonly` ``` +#### Tablet-Specific Targeting + +For debugging and troubleshooting, you can route queries to a specific tablet by its alias: + +```sql +USE `keyspace:shard@tablet_type|tablet-alias` +``` + +For example: +```sql +USE `mykeyspace:-80@replica|zone1-0000000100` +``` + +This targets a specific tablet within a shard, providing stable routing when you don't have direct access to the underlying MySQL instance. The tablet alias uses the format `cell-uid` (e.g., `zone1-0000000100`). + +Keep in mind: +- You must specify both the shard and tablet type (before the `|`) when targeting a tablet. +- Once set, all queries in the session route to this tablet until you change or clear the target. + +This is useful for: +- Debugging queries on a specific tablet +- Testing replica consistency by targeting individual replicas +- Ensuring query stability during troubleshooting + Or refer to another keyspace’s table via standard dot notation: ```sql