概述

用于查看表(包括内表和外表)的属性信息。

table_properties - 图1提示

该系统表自 2.1.6 和 3.0.2 版本支持。

所属数据库

information_schema

表信息

列名类型说明
TABLE_CATALOGVARCHAR(64)表所属 Catalog
TABLE_SCHEMAVARCHAR(64)表所属 Database
TABLE_NAMEVARCHAR(64)表名
PROPERTY_NAMESTRING属性名称
PROPERTY_VALUESTRING属性值

table_properties - 图2提示

关于表属性的具体减少,请参阅建表相关文档。

示例

1. 查询所有表属性

  1. mysql> select * from information_schema.table_properties;
  2. +---------------+---------------+----------------------+------------------------------------------------+-------------------------+
  3. | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PROPERTY_NAME | PROPERTY_VALUE |
  4. +---------------+---------------+----------------------+------------------------------------------------+-------------------------+
  5. ...
  6. | internal | test_database | test_table | min_load_replica_num | -1 |
  7. | internal | test_database | test_table | data_sort.col_num | 3 |
  8. | internal | test_database | test_table | group_commit_interval_ms | 10000 |
  9. | internal | test_database | test_table | data_sort.sort_type | LEXICAL |
  10. | internal | test_database | test_table | is_being_synced | false |
  11. | internal | test_database | test_table | binlog.enable | false |
  12. | internal | test_database | test_table | enable_mow_light_delete | false |
  13. | internal | test_database | test_table | binlog.ttl_seconds | 86400 |
  14. | internal | test_database | test_table | inverted_index_storage_format | V2 |
  15. | internal | test_database | test_table | time_series_compaction_empty_rowsets_threshold | 5 |
  16. | internal | test_database | test_table | default.replication_allocation | tag.location.default: 1 |
  17. | internal | test_database | test_table | time_series_compaction_level_threshold | 1 |
  18. | internal | test_database | test_table | time_series_compaction_time_threshold_seconds | 3600 |
  19. | internal | test_database | test_table | storage_format | V2 |
  20. | internal | test_database | test_table | store_row_column | false |
  21. | internal | test_database | test_table | light_schema_change | true |
  22. | internal | test_database | test_table | enable_unique_key_merge_on_write | false |
  23. | internal | test_database | test_table | in_memory | false |
  24. | internal | test_database | test_table | file_cache_ttl_seconds | 0 |
  25. | internal | test_database | test_table | group_commit_data_bytes | 134217728 |
  26. | internal | test_database | test_table | compaction_policy | size_based |
  27. | internal | test_database | test_table | _auto_bucket | false |
  28. | internal | test_database | test_table | binlog.max_history_nums | 9223372036854775807 |
  29. | internal | test_database | test_table | time_series_compaction_file_count_threshold | 2000 |
  30. | internal | test_database | test_table | skip_write_index_on_load | false |
  31. | internal | test_database | test_table | disable_auto_compaction | false |
  32. | internal | test_database | test_table | row_store_page_size | 16384 |
  33. | internal | test_database | test_table | time_series_compaction_goal_size_mbytes | 1024 |
  34. | internal | test_database | test_table | storage_medium | HDD |
  35. | internal | test_database | test_table | enable_single_replica_compaction | false |
  36. | internal | test_database | test_table | compression | LZ4F |
  37. | internal | test_database | test_table | binlog.max_bytes | 9223372036854775807 |
  38. +---------------+---------------+----------------------+------------------------------------------------+-------------------------+

2. 查询默认副本数

  1. mysql> select * from information_schema.table_properties where PROPERTY_NAME="default.replication_allocation";
  2. +---------------+----------------------+----------------------+--------------------------------+-------------------------+
  3. | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PROPERTY_NAME | PROPERTY_VALUE |
  4. +---------------+----------------------+----------------------+--------------------------------+-------------------------+
  5. | internal | `__internal_schema` | column_statistics | default.replication_allocation | tag.location.default: 1 |
  6. | internal | `__internal_schema` | partition_statistics | default.replication_allocation | tag.location.default: 1 |
  7. | internal | `__internal_schema` | audit_log | default.replication_allocation | tag.location.default: 1 |
  8. | internal | test_database | test_table | default.replication_allocation | tag.location.default: 1 |
  9. +---------------+----------------------+----------------------+--------------------------------+-------------------------+