# System Tables 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 Name** | **Column Type** | **Description** | | ----------------- | --------------- | ------------------------------------------------------------------------------- | | user\_id | INTEGER | ID of database user. | | user\_name | TEXT | Username of database user. | | is\_super\_user | BOOLEAN | Indicates whether or not the database user is a super user. | | default\_db\_id | INTEGER | ID of user’s default database on login. | | default\_db\_name | TEXT | Name of user’s default database on login. | | can\_login | BOOLEAN | Indicates 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 Name** | **Column Type** | **Description** | | ----------------- | --------------- | --------------------------- | | database\_id | INTEGER | ID of database. | | database\_name | TEXT | Name of database. | | owner\_id | INTEGER | User ID of database owner. | | owner\_user\_name | TEXT | Username 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 Name** | **Column Type** | **Description** | | ------------------------- | --------------- | ------------------------------------------------------------------------------------- | | role\_name | TEXT | Username or role name associated with permission. | | is\_user\_role | BOOLEAN | Boolean indicating whether or not the `role_name` column identifies a user or a role. | | database\_id | INTEGER | ID of database that contains the database object for which permission was granted. | | database\_name | TEXT | Name of database that contains the database object on which permission was granted. | | object\_name | TEXT | Name of database object on which permission was granted. | | object\_id | INTEGER | ID of database object on which permission was granted. | | object\_owner\_id | INTEGER | User id of the owner of the database object on which permission was granted. | | object\_owner\_user\_name | TEXT | Username of the owner of the database object on which permission was granted. | | object\_permission\_type | TEXT | Type of database object on which permission was granted. | | object\_permissions | TEXT\[] | 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 Name** | **Column Type** | **Description** | | --------------- | --------------- | --------------- | | role\_name | TEXT | Role name. | ## Tables The `tables` system table provides information about all database tables and contains the following columns: | **Column Name** | **Column Type** | **Description** | | --------------------- | --------------- | -------------------------------------------------------------------------------------- | | database\_id | INTEGER | ID of database that contains the table. | | database\_name | TEXT | Name of database that contains the table. | | table\_id | INTEGER | Table ID. | | table\_name | TEXT | Table name. | | owner\_id | INTEGER | User ID of table owner. | | owner\_user\_name | TEXT | Username of table owner. | | column\_count | INTEGER | Number of table columns. Note that internal system columns are included in this count. | | table\_type | TEXT | Type of tables. Possible values are `DEFAULT`, `VIEW`, `TEMPORARY` , and `FOREIGN`. | | view\_sql | TEXT | For views, SQL statement used in the view. | | max\_fragment\_size | INTEGER | Number of rows per fragment used by the table. | | max\_chunk\_size | BIGINT | Maximum size (in bytes) of table chunks. | | fragment\_page\_size | INTEGER | Size (in bytes) of table data pages. | | max\_rows | BIGINT | Maximum number of rows allowed by table. | | max\_rollback\_epochs | INTEGER | Maximum number of epochs a table can be rolled back to. | | shard\_count | INTEGER | Number of shards that exists for table. | | ddl\_statement | TEXT | `CREATE TABLE` DDL statement for table. | ## Dashboards The `dashboards` system table provides information about created dashboards (enterprise edition only) and contains the following columns: | **Column Name** | **Column Type** | **Description** | | ----------------- | --------------- | ---------------------------------------------- | | database\_id | INTEGER | ID of database that contains the dashboard. | | database\_name | TEXT | Name of database that contains the dashboard. | | dashboard\_id | INTEGER | Dashboard ID. | | dashboard\_name | TEXT | Dashboard name. | | owner\_id | INTEGER | User ID of dashboard owner. | | owner\_user\_name | TEXT | Username of dashboard owner. | | last\_updated\_at | TIMESTAMP | Timestamp of last dashboard update. | | data\_sources | TEXT\[] | 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 Name** | **Column Type** | **Description** | | --------------- | --------------- | -------------------------------------------- | | role\_name | TEXT | Name of assigned role. | | user\_name | TEXT | Username 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 Name** | **Column Type** | **Description** | | ---------------------- | --------------- | ------------------------------------------------------------------- | | node | TEXT | Node from which memory information is fetched. | | device\_id | INTEGER | Device ID. | | device\_type | TEXT | Type of device. Possible values are `CPU` and `GPU`. | | max\_page\_count | BIGINT | Maximum number of memory pages that can be allocated on the device. | | page\_size | BIGINT | Size (in bytes) of a memory page on the device. | | allocated\_page\_count | BIGINT | Number of allocated memory pages on the device. | | used\_page\_count | BIGINT | Number of used allocated memory pages on the device. | | free\_page\_count | BIGINT | Number 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 Name** | **Column Type** | **Description** | | -------------------- | --------------- | ----------------------------------------------------------------------- | | node | TEXT | Node from which memory information is fetched. | | database\_id | INTEGER | ID of database that contains the table that memory was allocated for. | | database\_name | TEXT | Name of database that contains the table that memory was allocated for. | | table\_id | INTEGER | ID of table that memory was allocated for. | | table\_name | TEXT | Name of table that memory was allocated for. | | column\_id | INTEGER | ID of column that memory was allocated for. | | column\_name | TEXT | Name of column that memory was allocated for. | | chunk\_key | INTEGER\[] | ID of cached table chunk. | | device\_id | INTEGER | Device ID. | | device\_type | TEXT | Type of device. Possible values are `CPU` and `GPU`. | | memory\_status | TEXT | Memory segment use status. Possible values are `FREE` and `USED`. | | page\_count | BIGINT | Number pages in the segment. | | page\_size | BIGINT | Size (in bytes) of a memory page on the device. | | slab\_id | INTEGER | ID of slab containing memory segment. | | start\_page | BIGINT | Page number of the first memory page in the segment. | | last\_touched\_epoch | BIGINT | Epoch 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 Name | Column Type | Description |
| node | TEXT | Node from which storage information is fetched. |
| database_id | INTEGER | ID of database that contains the table. |
| database_name | TEXT | Name of database that contains the table. |
| table_id | INTEGER | Table ID. |
| table_name | TEXT | Table Name. |
| epoch | INTEGER | Current table epoch. |
| epoch_floor | INTEGER | Minimum epoch table can be rolled back to. |
| fragment_count | INTEGER | Number of table fragments. |
| shard_id | INTEGER | Table shard ID. This value is only set for sharded tables. |
| data_file_count | INTEGER | Number of data files created for table. |
| metadata_file_count | INTEGER | Number of metadata files created for table. |
| total_data_file_size | BIGINT | Total size (in bytes) of data files. |
| total_data_page_count | BIGINT | Total number of pages across all data files. |
| total_free_data_page_count | BIGINT | Total number of free pages across all data files. |
| total_metadata_file_size | BIGINT | Total size (in bytes) of metadata files. |
| total_metadata_page_count | BIGINT | Total number of pages across all metadata files. |
| total_free_metadata_page_count | BIGINT | Total number of free pages across all metadata files. |
| total_dictionary_data_file_size | BIGINT | Total size (in bytes) of string dictionary files. |
| Column Name | Column Type | Description |
| log_timestamp | TIMESTAMP | Timestamp of log entry. |
| severity | TEXT | Severity level of log entry. Possible values are fatal, error, warning, and info. |
| message | TEXT | Log message. |
| Column Name | Column Type | Description |
| ip_address | TEXT | IP address of client making the web server request. |
| log_timestamp | TIMESTAMP | Timestamp of log entry. |
| http_method | TEXT | HTTP request method. |
| endpoint | TEXT | Web server request endpoint. |
| http_status | SMALLINT | HTTP response status code. |
| response_size | BIGINT | Response payload size in bytes. |