System Tables

View as Markdown

HeavyDB system tables provide a way to access information about database objects, database object permissions, and system resource (storage, CPU, and GPU memory) utilization. These system tables can be found in the information_schema database that is available by default on server startup. You can query system tables in the same way as regular tables, and you can use the SHOW CREATE TABLE command to view the table schemas.

Users

The users system table provides information about all database users and contains the following columns:

Column NameColumn TypeDescription
user_idINTEGERID of database user.
user_nameTEXTUsername of database user.
is_super_userBOOLEANIndicates whether or not the database user is a super user.
default_db_idINTEGERID of user’s default database on login.
default_db_nameTEXTName of user’s default database on login.
can_loginBOOLEANIndicates whether or not the database user account is activated and can log in.

Databases

The databases system table provides information about all created databases on the server and contains the following columns:

Column NameColumn TypeDescription
database_idINTEGERID of database.
database_nameTEXTName of database.
owner_idINTEGERUser ID of database owner.
owner_user_nameTEXTUsername of database owner.

Permissions

The permissions system table provides information about all user/role permissions for all database objects and contains the following columns:

Column NameColumn TypeDescription
role_nameTEXTUsername or role name associated with permission.
is_user_roleBOOLEANBoolean indicating whether or not the role_name column identifies a user or a role.
database_idINTEGERID of database that contains the database object for which permission was granted.
database_nameTEXTName of database that contains the database object on which permission was granted.
object_nameTEXTName of database object on which permission was granted.
object_idINTEGERID of database object on which permission was granted.
object_owner_idINTEGERUser id of the owner of the database object on which permission was granted.
object_owner_user_nameTEXTUsername of the owner of the database object on which permission was granted.
object_permission_typeTEXTType of database object on which permission was granted.
object_permissionsTEXT[]List of permissions that were granted on database object.

Roles

The roles system table lists all created database roles and contains the following columns:

Column NameColumn TypeDescription
role_nameTEXTRole name.

Tables

The tables system table provides information about all database tables and contains the following columns:

Column NameColumn TypeDescription
database_idINTEGERID of database that contains the table.
database_nameTEXTName of database that contains the table.
table_idINTEGERTable ID.
table_nameTEXTTable name.
owner_idINTEGERUser ID of table owner.
owner_user_nameTEXTUsername of table owner.
column_countINTEGERNumber of table columns. Note that internal system columns are included in this count.
table_typeTEXTType of tables. Possible values are DEFAULT, VIEW, TEMPORARY , and FOREIGN.
view_sqlTEXTFor views, SQL statement used in the view.
max_fragment_sizeINTEGERNumber of rows per fragment used by the table.
max_chunk_sizeBIGINTMaximum size (in bytes) of table chunks.
fragment_page_sizeINTEGERSize (in bytes) of table data pages.
max_rowsBIGINTMaximum number of rows allowed by table.
max_rollback_epochsINTEGERMaximum number of epochs a table can be rolled back to.
shard_countINTEGERNumber of shards that exists for table.
ddl_statementTEXTCREATE TABLE DDL statement for table.

Dashboards

The dashboards system table provides information about created dashboards (enterprise edition only) and contains the following columns:

Column NameColumn TypeDescription
database_idINTEGERID of database that contains the dashboard.
database_nameTEXTName of database that contains the dashboard.
dashboard_idINTEGERDashboard ID.
dashboard_nameTEXTDashboard name.
owner_idINTEGERUser ID of dashboard owner.
owner_user_nameTEXTUsername of dashboard owner.
last_updated_atTIMESTAMPTimestamp of last dashboard update.
data_sourcesTEXT[]List to data sources/tables used by dashboard.

Role Assignments

The role_assignments system table provides information about database roles that have been assigned to users and contains the following columns:

Column NameColumn TypeDescription
role_nameTEXTName of assigned role.
user_nameTEXTUsername of user that was assigned the role.

Memory Summary

The memory_summary system table provides high level information about utilized memory across CPU and GPU devices and contains the following columns:

Column NameColumn TypeDescription
nodeTEXTNode from which memory information is fetched.
device_idINTEGERDevice ID.
device_typeTEXTType of device. Possible values are CPU and GPU.
max_page_countBIGINTMaximum number of memory pages that can be allocated on the device.
page_sizeBIGINTSize (in bytes) of a memory page on the device.
allocated_page_countBIGINTNumber of allocated memory pages on the device.
used_page_countBIGINTNumber of used allocated memory pages on the device.
free_page_countBIGINTNumber of free allocated memory pages on the device.

Memory Details

The memory_details system table provides detailed information about allocated memory segments across CPU and GPU devices and contains the following columns:

Column NameColumn TypeDescription
nodeTEXTNode from which memory information is fetched.
database_idINTEGERID of database that contains the table that memory was allocated for.
database_nameTEXTName of database that contains the table that memory was allocated for.
table_idINTEGERID of table that memory was allocated for.
table_nameTEXTName of table that memory was allocated for.
column_idINTEGERID of column that memory was allocated for.
column_nameTEXTName of column that memory was allocated for.
chunk_keyINTEGER[]ID of cached table chunk.
device_idINTEGERDevice ID.
device_typeTEXTType of device. Possible values are CPU and GPU.
memory_statusTEXTMemory segment use status. Possible values are FREE and USED.
page_countBIGINTNumber pages in the segment.
page_sizeBIGINTSize (in bytes) of a memory page on the device.
slab_idINTEGERID of slab containing memory segment.
start_pageBIGINTPage number of the first memory page in the segment.
last_touched_epochBIGINTEpoch at which the segment was last accessed.

Storage Details

The storage_details system table provides detailed information about utilized storage per table and contains the following columns:

Column NameColumn TypeDescription
nodeTEXTNode from which storage information is fetched.
database_idINTEGERID of database that contains the table.
database_nameTEXTName of database that contains the table.
table_idINTEGERTable ID.
table_nameTEXTTable Name.
epochINTEGERCurrent table epoch.
epoch_floorINTEGERMinimum epoch table can be rolled back to.
fragment_countINTEGERNumber of table fragments.
shard_idINTEGERTable shard ID. This value is only set for sharded tables.
data_file_countINTEGERNumber of data files created for table.
metadata_file_countINTEGERNumber of metadata files created for table.
total_data_file_sizeBIGINTTotal size (in bytes) of data files.
total_data_page_countBIGINTTotal number of pages across all data files.
total_free_data_page_countBIGINTTotal number of free pages across all data files.
total_metadata_file_sizeBIGINTTotal size (in bytes) of metadata files.
total_metadata_page_countBIGINTTotal number of pages across all metadata files.
total_free_metadata_page_countBIGINTTotal number of free pages across all metadata files.
total_dictionary_data_file_sizeBIGINTTotal size (in bytes) of string dictionary files.

Log-Based System Tables

Log-based system tables are considered beta functionality in Release 6.1.0 and are disabled by default.

Request Logs

The request_logs system table provides information about HeavyDB Thrift API requests and contains the following columns:

Column NameColumn TypeDescription
log_timestampTIMESTAMPTimestamp of log entry.
severityTEXTSeverity level of log entry. Possible values are F (fatal), E (error), W (warning), and I (info).
process_idINTEGERProcess ID of the HeavyDB instance that generated the log entry.
query_idINTEGERID associated with a SQL query. A value of 0 indicates that either the log entry is unrelated to a SQL query or no query ID has been set for the log entry.
thread_idINTEGERID of thread that generated the log entry.
file_locationTEXTSource file name and line number where the log entry was generated.
api_nameTEXTName of Thrift API that the request was sent to.
request_duration_msBIGINTThrift API request duration in milliseconds.
database_nameTEXTRequest session database name.
user_nameTEXTRequest session username.
public_session_idTEXTRequest session ID.
query_stringTEXTQuery string for SQL query requests.
clientTEXTProtocol and IP address of client making the request.
dashboard_idINTEGERDashboard ID for SQL query requests coming from Immerse dashboards.
dashboard_nameTEXTDashboard name for SQL query requests coming from Immerse dashboards.
chart_idINTEGERChart ID for SQL query requests coming from Immerse dashboards.
execution_time_msBIGINTExecution time in milliseconds for SQL query requests.
total_time_msBIGINTTotal execution time (execution_time_ms + serialization time) in milliseconds for SQL query requests.

Server Logs

The server_logs system table provides HeavyDB server logs in tabular form and contains the following columns:

Column NameColumn TypeDescription
nodeTEXTNode containing logs.
log_timestampTIMESTAMPTimestamp of log entry.
severityTEXTSeverity level of log entry. Possible values are F (fatal), E (error), W (warning), and I (info).
process_idINTEGERProcess ID of the HeavyDB instance that generated the log entry.
query_idINTEGERID associated with a SQL query. A value of 0 indicates that either the log entry is unrelated to a SQL query or no query ID has been set for the log entry.
thread_idINTEGERID of thread that generated the log entry.
file_locationTEXTSource file name and line number where the log entry was generated.
messageTEXTLog message.

Web Server Logs

The web_server_logs system table provides HEAVY.AI Web Server logs in tabular form and contains the following columns (Enterprise Edition only):

Column NameColumn TypeDescription
log_timestampTIMESTAMPTimestamp of log entry.
severityTEXTSeverity level of log entry. Possible values are fatal, error, warning, and info.
messageTEXTLog message.

Web Server Access Logs

The web_server_access_logs system table provides information about requests made to the HEAVY.AI Web Server. The table contains the following columns:

Column NameColumn TypeDescription
ip_addressTEXTIP address of client making the web server request.
log_timestampTIMESTAMPTimestamp of log entry.
http_methodTEXTHTTP request method.
endpointTEXTWeb server request endpoint.
http_statusSMALLINTHTTP response status code.
response_sizeBIGINTResponse payload size in bytes.

Refreshing Logs System Tables

The logs system tables must be refreshed manually to view new log entries. You can run the REFRESH FOREIGN TABLES SQL command (for example, REFRESH FOREIGN TABLES server_logs, request_logs; ), or click the Refresh Data Now button on the table’s Data Manager page in Heavy Immerse.

Request Logs and Monitoring System Dashboard

The Request Logs and Monitoring system dashboard is built on the log-based system tables and provides visualization of request counts, performance, and errors over time, along with the server logs.

System Dashboards

Preconfigured system dashboards are built on various system tables. Specifically, two dashboards named System Resources and User Roles and Permissions are available by default. The Request Logs and Monitoring system dashboard is considered beta functionality and disabled by default. These dashboards can be found in the information_schema database, along with the system tables that they use.

Access to system dashboards is controlled using Heavy Immerse privileges; only users with Admin privileges or users/roles with access to the information_schema database can access the system dashboards.

Cross-linking must be enabled to allow cross-filtering across charts that use different system tables. Enable cross-linking by adding "ui/enable_crosslink_panel": true to the feature_flags section of the servers.json file.