Skip to content

[WIP] Tianmu Performance Schema Tables For 2.0

hustjieke edited this page Aug 31, 2022 · 1 revision

The tianmu_column_id Table

This is a read-only table stores table schema infos that are loaded in Tianmu. The table schema includes three fields:

Field Type annotation
ID bigint(21) unsigned A unique identifier
COLUMN_NAME varchar(64) Column name
TABLE_ID varchar(64) The ID of the table to which the column belongs

The tianmu_table_id Table

Just like tianmu_column_id, tianmu_table_id is a read-only table that stores ID,NAME,SCHEMA_NAME,TABLE_NAME loaded in Tianmu.

Field Type annotation
ID bigint(21) unsigned A unique identifier for this table
FULL_NAME varchar(64) The full name with schema, e.g.: testdb.t1
SCHEMA_NAME varchar(64) The schema that the table belongs to
TABLE_NAME varchar(64) The table name

The tianmu_exec_stats Table

The tianmu_exec_stats table stores statistics during the query executed in Tianmu backend nodes. One row for each backend node with a maximum of 1000 queries.

Field Type annotation
QUERY_ID bigint(21) unsigned The query ID executed in Tianmu
NODE_ID varchar(32) The tianmu node ID executed the query above
EXEC_TEXT json Stores execution statistics during query

The tianmu_query_stats table

Just like tianmu_exec_stats table, the exact query message is recorded in tianmu_query_stats with the last 1000 executed queries, both for
successfully and failed queries. The text message stores in json format.

Field Type annotation
QUERY_ID bigint(21) unsigned The query ID executed in Tianmu
QUERY_TEXT json stores the exact query
QEXEC_TEXT json Stores execution logs during query
QKRN_TEXT json Stores logical query execution plan
QEXEC_TEXT json Stroes physical query execution plan.

The tianmu_nodes Table

This is a read-only table. It saves tianmu nodes information. The table schema has next columns.

Field Type annotation
ID bigint(21) unsigned A unique identifier for the Tianmu node.
CORES int The number of cores used in Tianmu node.
MEMORY_USAGE bigint(21) Memory usage in Tianmu node, recorded in bytes, refresh every 4 seconds
MEMORY_TOTAL bigint Total memory allocated from Tianmu node, recoreded in bytes
STATUS enum The status of the Tianmu node: (NOTAVAIL_STATE, AVAIL_STATE, DOWN_STATE, IDLE_STATE, DEAD_STATE)
IP varchar(32) The address of Tianmu node
PORT int The port of tianmu node
CLUSTER_EVENT_NUM int The number of cluster events such as node down, node up, and so on.
NUM_OBJSTORE_GETS int Number of GET requests from the node to the object store.
NUM_OBJSTORE_PUTS int The number of PUT requests from the node to the object store.
NUM_OBJSTORE_DELETES int The number of DELETE requests from the node to the object store.

The tianmu_tables Table

This is a read-only table. It provides the system change number (SCN) for tables loaded in Tianmu. The SCN is an internal number that represents a point in time according to the system logical clock that the table snapshot was transactionally consistent with the source table.

Field Type annotation
ID bigint(21) unsigned A unique identifier for this table
SNAPSHOT_SCN bigint(21) unsigned The system change number (SCN) of the table snapshot
PERSISTED_SCN bigint(21) unsigned The SCN up to which changes are persisted.
NROWS bigint(21) unsigned Num of rows loaded for the table
LOAD_STATUS enum The load status of the table(NOLOAD_STATE, LOADING_STATE, AVAIL_STATE, UNLOADING_STATE, INRECOVERY_STATE, UNAVAIL_STATE)
LOAD_PROGRESS varchar(10) The load progress of the table expressed as a percentage value.
SIZE_BYTES bigint(21) The amount of bytes loaded for the table
| QUERY_COUNT| bigint(21) Num of queries referenced to this table
| LAST_QUERIED | timestamp The timestamp of the last query that referenced the table.
LOAD_START_TIMESTAMP timestamp The starting load time to this table.
LOAD_END_TIMESTAMP timestamp The completion load time to this table.

sys_tianmu from StoneDB v1.0

The next four sys tables from get from StoneDB v1.0.

mysql> use sys_tianmu
Database changed
mysql> show tables;
+--------------------------+
| Tables_in_sys_tianmu     |
+--------------------------+
| column_ttl               |
| columns                  |
| decomposition_dictionary |
| logs                     |
+--------------------------+

mysql> desc column_ttl;
+-----------------+--------------+------+-----+---------+-------+
| Field           | Type         | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| database_name   | varchar(255) | NO   |     | NULL    |       |
| table_name      | varchar(255) | NO   |     | NULL    |       |
| column_name     | varchar(255) | NO   |     | NULL    |       |
| database_suffix | varchar(255) | NO   |     | NULL    |       |
| table_suffix    | varchar(255) | NO   |     | NULL    |       |
| ttl             | int(11)      | NO   |     | NULL    |       |
+-----------------+--------------+------+-----+---------+-------+
6 rows in set (0.03 sec)

mysql> desc columns;
+---------------+--------------+------+-----+---------+-------+
| Field         | Type         | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| database_name | varchar(255) | NO   |     | NULL    |       |
| table_name    | varchar(255) | NO   |     | NULL    |       |
| column_name   | varchar(255) | NO   |     | NULL    |       |
| decomposition | varchar(20)  | NO   |     | NULL    |       |
+---------------+--------------+------+-----+---------+-------+
4 rows in set (0.01 sec)

mysql> desc decomposition_dictionary;
+---------+--------------+------+-----+---------+-------+
| Field   | Type         | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| ID      | varchar(20)  | NO   |     | NULL    |       |
| RULE    | varchar(100) | NO   |     | NULL    |       |
| COMMENT | varchar(255) | NO   |     | NULL    |       |
+---------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> desc logs;
+-------+--------------+------+-----+-------------------+-------+
| Field | Type         | Null | Key | Default           | Extra |
+-------+--------------+------+-----+-------------------+-------+
| ts    | timestamp    | NO   |     | CURRENT_TIMESTAMP |       |
| msg   | varchar(255) | NO   |     | NULL              |       |
+-------+--------------+------+-----+-------------------+-------+