SHOW extensions

In Vitess, SHOW has been extended with additional functionality.

SHOW Statements

Vitess supports the following additional SHOW statements:

  • SHOW GLOBAL GTID_EXECUTED [FROM <keyspace>] — retrieves the global gtid_executed status variable from each shard in the keyspace either selected or provided in the query.
1. Example Output for customer keyspace:
2. +----------+-------------------------------------------+-------+
3. | db_name  | gtid_executed                             | shard |
4. +----------+-------------------------------------------+-------+
5. | customer | e9148eb0-a320-11eb-8026-98af65a6dc4a:1-43 | 80-   |
6. | customer | e0f64aca-a320-11eb-9be4-98af65a6dc4a:1-43 | -80   |
7. +----------+-------------------------------------------+-------+
  • SHOW KEYSPACES — A list of keyspaces available.
1. Example Output:
2. +----------+
3. | Database |
4. +----------+
5. | commerce |
6. | customer |
7. +----------+
  • SHOW VITESS_REPLICATION_STATUS [LIKE "<Keyspace/<Shard>"] (Experimental; 12.0+) — Shows the Replication (not VReplication) health for the Vitess deployment. It returns a row for each REPLICA and RDONLY tablet in the topology — with support for filtering by Keyspace/Shard using a LIKE clause — providing relevant health and status information, including the current tablet throttler status.
1. Example Output:
2. +----------+-------+------------+------------------+--------------+--------------------+-------------------------------------------------------------------------+----------------+-----------------------------------------+
3. | Keyspace | Shard | TabletType | Alias            | Hostname     | ReplicationSource  | ReplicationHealth                                                       | ReplicationLag | ThrottlerStatus                         |
4. +----------+-------+------------+------------------+--------------+--------------------+-------------------------------------------------------------------------+----------------+-----------------------------------------+
5. | commerce | 0     | REPLICA    | zone1-0000000101 | 52030e360852 | 52030e360852:17100 | {"EventStreamRunning":"Yes","EventApplierRunning":"Yes","LastError":""} | 0              | {"state":"OK","load":0.00,"message":""} |
6. | commerce | 0     | RDONLY     | zone1-0000000102 | 52030e360852 | 52030e360852:17100 | {"EventStreamRunning":"Yes","EventApplierRunning":"Yes","LastError":""} | 0              | {"state":"OK","load":0.00,"message":""} |
7. +----------+-------+------------+------------------+--------------+--------------------+-------------------------------------------------------------------------+----------------+-----------------------------------------+
  • SHOW VITESS_SHARDS — A list of shards that are available.
1. Example Output:
2. +--------------+
3. | Shards       |
4. +--------------+
5. | commerce/0   |
6. | customer/-80 |
7. | customer/80- |
8. +--------------+
  • SHOW VITESS_TABLETS — Information about the current Vitess tablets such as the keyspace, key ranges, tablet type, hostname, and status.
1. Example Output:
2. +-------+----------+-------+------------+---------+------------------+------------+----------------------+
3. | Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname   | PrimaryTermStartTime |
4. +-------+----------+-------+------------+---------+------------------+------------+----------------------+
5. | zone1 | commerce | 0     | PRIMARY    | SERVING | zone1-0000000100 | <redacted> | 2021-04-22T04:10:29Z |
6. | zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000101 | <redacted> |                      |
7. | zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 | <redacted> |                      |
8. | zone1 | customer | -80   | PRIMARY    | SERVING | zone1-0000000300 | <redacted> | 2021-04-22T04:12:23Z |
9. | zone1 | customer | -80   | REPLICA    | SERVING | zone1-0000000301 | <redacted> |                      |
10. | zone1 | customer | -80   | RDONLY     | SERVING | zone1-0000000302 | <redacted> |                      |
11. | zone1 | customer | 80-   | PRIMARY    | SERVING | zone1-0000000400 | <redacted> | 2021-04-22T04:12:23Z |
12. | zone1 | customer | 80-   | REPLICA    | SERVING | zone1-0000000401 | <redacted> |                      |
13. | zone1 | customer | 80-   | RDONLY     | SERVING | zone1-0000000402 | <redacted> |                      |
14. +-------+----------+-------+------------+---------+------------------+------------+----------------------+
  • SHOW VSCHEMA TABLES — A list of tables available in the current keyspace’s vschema.
1. Example Output for customer keyspace:
2. +----------+
3. | Tables   |
4. +----------+
5. | corder   |
6. | customer |
7. | dual     |
8. +----------+
  • SHOW VSCHEMA VINDEXES — Information about the current keyspace’s vindexes such as the keyspace, name, type, params, and owner. Optionally supports an “ON” clause with a table name.
1. Example Output:
2. +----------+------+------+--------+-------+
3. | Keyspace | Name | Type | Params | Owner |
4. +----------+------+------+--------+-------+
5. | customer | hash | hash |        |       |
6. +----------+------+------+--------+-------+
  • SHOW VITESS_THROTTLER STATUS — shows status for all tablet throttlers in current keyspace
1. Example Output:
2. +-------+---------+-----------+
3. | shard | enabled | threshold |
4. +-------+---------+-----------+
5. | -80   |       1 |       1.5 |
6. | 80-   |       1 |       1.5 |
7. +-------+---------+-----------+