# 系统表和系统视图
表1GaussDB数据库与MySQL的系统表或系统视图差异 
| 系统表或系统视图                    | 差异列                           | GaussDB数据库与MySQL的差异                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| information_schema.columns  | generation_expression         | 该字段输出结果因涉及GaussDB数据库与MySQL的表达式的字符串拼接逻辑的不同而存在差异。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| information_schema.columns  | data_type                     | 该字段输出结果因涉及GaussDB数据库的数据类型format_type输出，目前未修改，与MySQL存在差异。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| information_schema.columns  | column_type                   | 该字段输出结果因涉及GaussDB数据库的数据类型format_type输出，目前未修改，与MySQL存在差异。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| information_schema.tables   | engine                        | GaussDB数据库中： - ENGINE对齐information_schema.engines数据。  - 部分系统表ENGINE为空。  - 在默认为ASTORE表且未指定STORAGE_TYPE时ENGINE为空。                                                                       |
| information_schema.tables   | version                      | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| information_schema.tables   | row_format                     | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| information_schema.tables   | avg_row_length               | GaussDB数据库下表示使用数据文件除以所有元组数（包括活元组和死元组）的结果。表中没有元组，值为null。                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| information_schema.tables   | max_data_length              | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.tables   | data_free                     | GaussDB数据库中表示死元组在总元组中的比例乘以数据文件大小。如果表中没有元组，则为null。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.tables   | check_time                     | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| information_schema.tables   | create_time                   | 在GaussDB数据库下，此字段与MySQL行为表现有差异，对于创建视图的情形MySQL中该字段置null，GaussDB数据库则显示实际的创建表时间。数据库自带的表，视图设置null。                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| information_schema.tables   | update_time                   | GaussDB数据库自带的表，视图设置null。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| information_schema.tables   | table_collation                 | 在GaussDB数据库下，此字段与MySQL行为表现有差异。如果表指定的是视图，则为null。如果指定的表在创建时，未使用COLLATE子句指定列的排序规则，则为null。                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| information_schema.statistics | collation                    | GaussDB数据库只有值A、D，不会是NULL。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| information_schema.statistics | packed                         | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| information_schema.statistics | sub_part                       | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.statistics | comment                         | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| information_schema.partitions | subpartition_name              | GaussDB数据库中，如果分区不是子分区，则为null。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| information_schema.partitions | subpartition_ordinal_position | GaussDB数据库中，如果分区不是子分区，则为null。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| information_schema.partitions | partition_method              | GaussDB数据库中，分区策略。如果分区不是一级分区，则为null。 - 'r'：范围分区。  - 'i'：间隔分区。  - 'l'：list分区。  - 'h'：hash分区。           |
| information_schema.partitions | subpartition_method            | GaussDB数据库中，子分区策略。如果分区不是二级分区，则为null。 - 'r'：范围分区。  - 'i'：间隔分区。  - 'l'：list分区。  - 'h'：hash分区。   |
| information_schema.partitions | partition_description           | GaussDB数据库中，区分一级分区和二级分区。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| information_schema.partitions | partition_expression            | GaussDB数据库中，仅支持表达式分区表，显示分区表中分区键表达式信息，非表达式不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| information_schema.partitions | subpartition_expression       | GaussDB数据库中，仅支持表达式分区表，显示分区表中分区键表达式信息，非表达式不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| information_schema.partitions | data_length                     | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| information_schema.partitions | max_data_length                | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| information_schema.partitions | index_length                   | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| information_schema.partitions | data_free                    | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.partitions | create_time                   | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.partitions | update_time                   | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| information_schema.partitions | check_time                     | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.partitions | checksum                       | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| information_schema.partitions | partition_comment               | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| information_schema.partitions | nodegroup                      | GaussDB数据库中不支持该字段。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
![](https://support.huaweicloud.com/centralized-ref-v10-gaussdb/public_sys-resources/note_3.0-zh-cn.png)
- 视图中对于整型的类型回显，不支持指定精度范围。如MySQL的bigint(1)，GaussDB数据库下对应的是bigint类型，MySQL中bigint(21) unsigned，在GaussDB数据库下对应的是bigint unsigned类型。
- MySQL中int类型，在GaussDB数据库中是integer类型。
- m_schema.columns_priv视图的Column_priv字段、m_schema.tables_priv视图的Table_priv,Column_priv字段、m_schema.procs_priv视图的Routine_type,Proc_priv字段、m_schema.proc视图的type,language,sql_data_access,is_deterministic,security_type,sql_mode字段、m_schema.func视图的type字段均不支持，在此版本中不予显示。
- 由于information_schema.tables、information_schema.statistics、information_schema.partitions中部分字段基于统计信息获取，查看前请先执行ANALYZE，更新统计信息后再查看（如果数据库中更新数据，建议延迟执行ANALYZE）。
- information_schema.statistics包含的索引列需要是创建索引中索引列是完整的表列，如果索引列是表达式，则不在这个视图中。
- information_schema.partitions中一级分区和二级分区分开呈现。
- 视图中的grantee字段，MySQL的格式是'*user_name* '@'*host_name*' ，在GaussDB数据库中是被授予权限的用户或角色的名称。
- 视图中的host字段，在GaussDB数据库中返回当前节点的hostname。
- m_schema.tables_priv、information_schema.user_privileges、information_schema.schema_privileges，information_schema.table_privileges、information_schema.column_privileges、m_schema.columns_priv、m_schema.func、m_schema.procs_priv 在MySQL下需要授权后才能查看视图内容，GaussDB数据库可以根据默认权限查看到对应的内容。如对于表t1，在MySQL下需要先对t1给对应的用户授权，才能在权限视图中看到对应的权限信息，GaussDB数据库下则可以直接在视图中看到t1表相关的权限信息。
- m_schema中的系统视图，但在MySQL是系统表。
- information_schema.views中的VIEW_DEFINITION以及information_schema.routines中的ROUTINE_DEFINITION不做字符序控制。
- [Schema-M-Compatibility兼容模式](https://support.huaweicloud.com/centralized-ref-v10-gaussdb/gaussdb-38-1922.html)章节所列举的字符类型的视图字段，字符集使用utf8mb4，字符序使用utf8mb4_bin或utf8mb4_general_ci，字符序优先级为[字符集和字符序合并规则](https://support.huaweicloud.com/centralized-ref-v10-gaussdb/gaussdb-38-0445.html)章节所描述的"支持字符序的数据类型的列"的优先级，和MySQL存在差异。
 
