Information Schema
The StarRocks Information Schema is a database within each StarRocks instance. Information Schema contains several read-only, system-defined views that store extensive metadata information of all objects that the StarRocks instance maintains. The StarRocks Information Schema is based on the SQL-92 ANSI Information Schema, but with the addition of views and functions that are specific to StarRocks.
From v3.2.0, The StarRocks Information Schema supports manage metadata for external catalogs.
View metadata via Information Schema
You can view the metadata information within a StarRocks instance by querying the content of views in Information Schema.
The following example checks metadata information about a table named table1 in StarRocks by querying the view tables.
MySQL > SELECT * FROM information_schema.tables WHERE TABLE_NAME like 'table1'\G
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test_db
TABLE_NAME: table1
TABLE_TYPE: BASE TABLE
ENGINE: StarRocks
VERSION: NULL
ROW_FORMAT:
TABLE_ROWS: 4
AVG_ROW_LENGTH: 1657
DATA_LENGTH: 6630
MAX_DATA_LENGTH: NULL
INDEX_LENGTH: NULL
DATA_FREE: NULL
AUTO_INCREMENT: NULL
CREATE_TIME: 2023-06-13 11:37:00
UPDATE_TIME: 2023-06-13 11:38:06
CHECK_TIME: NULL
TABLE_COLLATION: utf8_general_ci
CHECKSUM: NULL
CREATE_OPTIONS:
TABLE_COMMENT:
1 row in set (0.01 sec)
Views in Information Schema
The StarRocks Information Schema contains the following metadata views:
| View | Description |
|---|---|
| analyze_status | Status of analyze jobs. |
| applicable_roles | Roles that are applicable to the current user. |
| be_bvars | bRPC statistics, such as RPC latency and QPS, for some StarRocks components. |
| be_cloud_native_compactions | Compaction transactions running on the CNs of a shared-data cluster. |
| be_compactions | Statistics on compaction tasks. |
| be_configs | Configuration parameters of each BE node. |
| be_logs | Logs of each BE node. |
| be_metrics | Metrics of each BE node. |
| be_tablets | Tablets on each BE node. |
| be_threads | Threads running on each BE node. |
| be_txns | Transactions on each BE node. |
| character_sets | The character sets available. |
| collations | The collations available. |
| column_stats_usage | Usage of column statistics. |
| columns | All table columns and view columns. |
| fe_metrics | Metrics of each FE node. |
| fe_tablet_schedules | Tablet scheduling tasks on FE nodes. |
| fe_threads | Threads running on each FE node. |
| global_variables | Global variables. |
| load_tracking_logs | Error logs of load jobs. |
| loads | Results of load jobs. |
| materialized_view_refresh_jobs | Job-level information about materialized view refreshes. |
| materialized_views | All materialized views. |
| partitions_meta | Partitions of tables. |
| pipe_files | Status of the data files to be loaded via a specified pipe. |
| pipes | All pipes stored in the current or specified database. |
| recyclebin_catalogs | Deleted databases, tables, and partitions held in the FE recycle bin. |
| routine_load_jobs | Routine Load jobs. |
| schemata | Databases. |
| session_variables | Session variables. |
| stream_loads | Stream Load jobs. |
| tables | Tables. |
| tables_config | Configuration of tables. |
| task_runs | Execution of asynchronous tasks. |
| tasks | Asynchronous tasks. |
| verbose_session_variables | Session variable details, including default values and whether they have been changed. |
| views | All user-defined views. |
| warehouse_metrics | Metrics of each warehouse. |
| warehouse_queries | Queries running on each warehouse. |
Views defined for compatibility
The following views are defined but not implemented in StarRocks. Each page carries a note to that effect.
| View | Description |
|---|---|
| column_privileges | Privileges granted on columns. |
| engines | Storage engines. |
| events | Event Manager events. |
| key_column_usage | Columns restricted by a unique, primary key, or foreign key constraint. |
| partitions | Table partitions. Use partitions_meta instead. |
| referential_constraints | Referential (foreign key) constraints. |
| routines | Stored routines (stored procedures and stored functions). |
| schema_privileges | Database privileges. |
| statistics | Table indexes. |
| table_constraints | Which tables have constraints. |
| table_privileges | Table privileges. |
| triggers | Triggers. |
| user_privileges | User privileges. |