MatrixOne Catalog
MatrixOne catalog is a component where MatrixOne stores system information. We can access the system information by mo_catalog
database. The mo_catalog
database is created by MatrixOne at initialization.
In 0.5.1, the mo_catalog
is not fully implemented, users can check basic information about the their database and tables, but writing values into mo_catalog
by users is not supported yet.
There are three tables in the mo_catalog
database:
mo_database table
This table contains the database information.
- table structure:
Attributes | Type | Primary key | Description |
---|---|---|---|
datname | varchar(256) | Primary key | database name |
dat_catalog_name | varchar(256) | catalog name | |
dat_createsql | varchar(4096) | create sql |
- table initial rows:
At initialization, mo_database
have some default rows in place.
datname | dat_catalog_name | dat_createsql |
---|---|---|
mo_catalog | def | hardcode |
information_schema | def | create database if not exists information_schema |
system_metrics | def |
mo_tables table
This table contains the information about the table, index, view etc.
- table structure:
Attributes | Type | Primary key | Description |
---|---|---|---|
relname | varchar(256) | PK | Name of the table, index, view, etc. |
reldatabase | varchar(256) | PK,FK | The database that contains this relation. reference mo_database.datname |
relpersistence | char(1) | p = permanent table, t = temporary table | |
relkind | char(1) | r = ordinary table, i = index, S = sequence, v = view, m = materialized view | |
rel_comment | varchar(1024) | comment | |
rel_createsql | varchar(4096) | create sql |
- table initial rows:
At initialization, mo_tables
have some default rows in place.
relname | reldatabase | repersistence | relkind | rel_createsql | rel_comment |
---|---|---|---|---|---|
mo_database | mo_catalog | ‘p’ | ‘r’ | tae hardcode | databases |
mo_tables | mo_catalog | ‘p’ | ‘r’ | tae hardcode | tables |
mo_columns | mo_catalog | ‘p’ | ‘r’ | tae hardcode | columns |
mo_global_variables | mo_catalog | ‘p’ | ‘r’ | create sql | system variables |
mo_user | mo_catalog | ‘p’ | ‘r’ | create sql | user |
schemata | information_schema | ‘p’ | ‘v’ | create sql | schemas |
tables | information_schema | ‘p’ | ‘v’ | create sql | tables |
columns | information_schema | ‘p’ | ‘v’ | create sql | columns |
key_column_usage | information_schema | ‘p’ | ‘v’ | create sql | columns related to unique, primary key, or foreign key |
views | information_schema | ‘p’ | ‘v’ | create sql | views |
mo_columns table
This table contains the information about the table attributes.
- table structure:
Attributes | Type | Primary key | Description |
---|---|---|---|
att_database | varchar(256) | PK | database |
att_relname | varchar(256) | PK,UK | The table this column belongs to.(references mo_tables.relname) |
attname | varchar(256) | PK | The column name |
atttyp | int | The data type of this column (zero for a dropped column). | |
attnum | int | UK | The number of the column. Ordinary columns are numbered from 1 up. |
att_length | int | bytes count for the type. | |
attnotnull | tinyint(1) | This represents a not-null constraint. | |
atthasdef | tinyint(1) | This column has a default expression or generation expression. | |
att_default | varchar(1024) | default expression | |
attisdropped | tinyint(1) | This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL. | |
att_constraint_type | char(1) | p = primary key constraint, n=no constraint | |
att_is_unsigned | tinyint(1) | unsigned or not | |
att_is_auto_increment | tinyint | auto increment or not | |
att_comment | varchar(1024) | comment | |
att_is_hidden | tinyint(1) | hidden or not |
- table initial rows:
att_database | att_relname | attname | atttyp | attnum | attnotnull | atthasdef | att_default | attisdropped | att_constraint_type | att_is_unsigned | att_is_auto_increment | att_comment | att_is_hidden |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mo_catalog | mo_database | datname | varchar | 0 | 1 | 0 | ‘’ | 0 | ‘p’ | 0 | 0 | ‘database name’ | 0 |
mo_catalog | mo_database | dat_catalog_name | varchar | 1 | 1 | 0 | ‘’ | 0 | ‘p’ | 0 | 0 | ‘catalog’ | 0 |
mo_catalog | mo_database | dat_createsql | varchar | 2 | 1 | ||||||||
mo_catalog | mo_tables | relname | varchar | 0 | 1 | ‘p’ | |||||||
mo_catalog | mo_tables | reldatabase | varchar | 1 | 1 | ‘p’ | |||||||
mo_catalog | mo_tables | relpersistence | char | 2 | 1 | ||||||||
mo_catalog | mo_tables | relkind | char | 3 | 1 | ||||||||
mo_catalog | mo_tables | rel_createsql | varchar | 4 | 0 | ||||||||
mo_catalog | mo_tables | rel_comment | varchar | 5 | 0 | ||||||||
mo_catalog | mo_columns | att_database | varchar | 0 | 1 | ||||||||
mo_catalog | mo_columns | att_relname | varchar | 1 | 1 | ||||||||
mo_catalog | mo_columns | attname | varchar | 2 | 1 | ||||||||
mo_catalog | mo_columns | atttyp | int | 3 | 1 | ||||||||
mo_catalog | mo_columns | attnum | int | 4 | 1 | ||||||||
mo_catalog | mo_columns | attnotnull | tinyint | 5 | 1 | ||||||||
mo_catalog | mo_columns | atthasdef | tinyint | 6 | 1 | ||||||||
mo_catalog | mo_columns | att_default | varchar | 7 | 0 | ||||||||
mo_catalog | mo_columns | attisdropped | tinyint | 8 | 1 | ||||||||
mo_catalog | mo_columns | att_constraint_type | char | 9 | 1 | ||||||||
mo_catalog | mo_columns | att_is_unsigned | tinyint | 10 | 1 | ||||||||
mo_catalog | mo_columns | att_is_auto_increment | tinyint | 11 | 1 | ||||||||
mo_catalog | mo_columns | att_comment | varchar | 12 | 0 | ||||||||
mo_catalog | mo_columns | att_is_hidden | tinyint | 13 | 1 | ||||||||
… |
mo_global_variables table
This table contains the information about the system variables.
- table structure:
Attributes | Type | Primary key | Description |
---|---|---|---|
gv_variable_name | varchar(256) | PK | variable name |
gv_variable_value | varchar(1024) | variable value |
- table initial rows:
gv_variable_name | gv_variable_value |
---|---|
gv_variable_name | gv_variable_value |
max_allowed_packet | 67108864 |
version_comment | MatrixOne |
port | 6001 |
host | 0.0.0.0 |
storePath | ./store |
batchSizeInLoadData | 40000 |
… |
mo_user table
This table contains the information of user accounts.
- table structure:
Attributes | Type | Primary key | Description |
---|---|---|---|
user_host | varchar(256) | PK | user host |
user_name | varchar(256) | PK | user name |
Select_priv | char | ‘N’,’Y’ | |
Insert_priv | char | ‘N’,’Y’ | |
Update_priv | char | ‘N’,’Y’ | |
Delete_priv | char | ‘N’,’Y’ | |
Create_priv | char | ‘N’,’Y’ | |
Drop_priv | char | ‘N’,’Y’ | |
Reload_priv | char | ‘N’,’Y’ | |
Shutdown_priv | char | ‘N’,’Y’ | |
Process_priv | char | ‘N’,’Y’ | |
File_priv | char | ‘N’,’Y’ | |
Grant_priv | char | ‘N’,’Y’ | |
References_priv | char | ‘N’,’Y’ | |
Index_priv | char | ‘N’,’Y’ | |
Alter_priv | char | ‘N’,’Y’ | |
Show_db_priv | char | ‘N’,’Y’ | |
Super_priv | char | ‘N’,’Y’ | |
Create_tmp_table_priv | char | ‘N’,’Y’ | |
Lock_tables_priv | char | ‘N’,’Y’ | |
Execute_priv | char | ‘N’,’Y’ | |
Repl_slave_priv | char | ‘N’,’Y’ | |
Repl_client_priv | char | ‘N’,’Y’ | |
Create_view_priv | char | ‘N’,’Y’ | |
Show_view_priv | char | ‘N’,’Y’ | |
Create_routine_priv | char | ‘N’,’Y’ | |
Alter_routine_priv | char | ‘N’,’Y’ | |
Create_user_priv | char | ‘N’,’Y’ | |
Event_priv | char | ‘N’,’Y’ | |
Trigger_priv | char | ‘N’,’Y’ | |
Create_tablespace_priv | char | ‘N’,’Y’ | |
max_questions | int unsigned | ||
max_updates | int unsigned | ||
max_connections | int unsigned | ||
max_user_connections | int unsigned | ||
authentication_string | varchar(4096) | password | |
account_locked | char | ‘N’,’Y’ | |
Create_role_priv | char | ‘N’,’Y’ | |
Drop_role_priv | char | ‘N’,’Y’ |
- table initial rows:
user_host | user_name | authentication_string |
---|---|---|
localhost | root | ‘’ |
localhost | dump | 111 |
… |