Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down