8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

30.4.1 sys 模式对象索引30.4.1 sys Schema Object Index

下面的表列出了 sys 模式对象,并提供了每个对象的简短描述。The following tables list sys schema objects and provide a short description of each one.

表 30.1 sys 模式表和触发器Table 30.1 sys Schema Tables and Triggers

表或触发器名称Table or Trigger Name 说明Description
sys_configsys_config sys 模式配置选项表sys schema configuration options table
sys_config_insert_set_usersys_config_insert_set_user sys_config 插入触发器sys_config insert trigger
sys_config_update_set_usersys_config_update_set_user sys_config 更新触发器sys_config update trigger

表 30.2 sys 模式视图Table 30.2 sys Schema Views

视图名称View Name 说明Description 已弃用Deprecated
host_summary, x$host_summaryhost_summary, x$host_summary 按主机分组的语句活动、文件 I/O 和连接Statement activity, file I/O, and connections, grouped by host
host_summary_by_file_io, x$host_summary_by_file_iohost_summary_by_file_io, x$host_summary_by_file_io 按主机分组的文件 I/OFile I/O, grouped by host
host_summary_by_file_io_type, x$host_summary_by_file_io_typehost_summary_by_file_io_type, x$host_summary_by_file_io_type 按主机和事件类型分组的文件 I/OFile I/O, grouped by host and event type
host_summary_by_stages, x$host_summary_by_stageshost_summary_by_stages, x$host_summary_by_stages 按主机分组的语句阶段Statement stages, grouped by host
host_summary_by_statement_latency, x$host_summary_by_statement_latencyhost_summary_by_statement_latency, x$host_summary_by_statement_latency 按主机分组的语句统计Statement statistics, grouped by host
host_summary_by_statement_type, x$host_summary_by_statement_typehost_summary_by_statement_type, x$host_summary_by_statement_type 按主机和语句分组执行的语句Statements executed, grouped by host and statement
innodb_buffer_stats_by_schema, x$innodb_buffer_stats_by_schemainnodb_buffer_stats_by_schema, x$innodb_buffer_stats_by_schema 按模式分组的 InnoDB 缓冲区信息InnoDB buffer information, grouped by schema
innodb_buffer_stats_by_table, x$innodb_buffer_stats_by_tableinnodb_buffer_stats_by_table, x$innodb_buffer_stats_by_table 按模式和表分组的 InnoDB 缓冲区信息InnoDB buffer information, grouped by schema and table
innodb_lock_waits, x$innodb_lock_waitsinnodb_lock_waits, x$innodb_lock_waits InnoDB 锁信息InnoDB lock information
io_by_thread_by_latency, x$io_by_thread_by_latencyio_by_thread_by_latency, x$io_by_thread_by_latency 按线程分组的 I/O 消费者I/O consumers, grouped by thread
io_global_by_file_by_bytes, x$io_global_by_file_by_bytesio_global_by_file_by_bytes, x$io_global_by_file_by_bytes 按文件和字节分组的全局 I/O 消费者Global I/O consumers, grouped by file and bytes
io_global_by_file_by_latency, x$io_global_by_file_by_latencyio_global_by_file_by_latency, x$io_global_by_file_by_latency 按文件和延迟分组的全局 I/O 消费者Global I/O consumers, grouped by file and latency
io_global_by_wait_by_bytes, x$io_global_by_wait_by_bytesio_global_by_wait_by_bytes, x$io_global_by_wait_by_bytes 按字节分组的全局 I/O 消费者Global I/O consumers, grouped by bytes
io_global_by_wait_by_latency, x$io_global_by_wait_by_latencyio_global_by_wait_by_latency, x$io_global_by_wait_by_latency 按延迟分组的全局 I/O 消费者Global I/O consumers, grouped by latency
latest_file_io, x$latest_file_iolatest_file_io, x$latest_file_io 按文件和线程分组的最新 I/OMost recent I/O, grouped by file and thread
memory_by_host_by_current_bytes, x$memory_by_host_by_current_bytesmemory_by_host_by_current_bytes, x$memory_by_host_by_current_bytes 按主机分组的内存使用情况Memory use, grouped by host
memory_by_thread_by_current_bytes, x$memory_by_thread_by_current_bytesmemory_by_thread_by_current_bytes, x$memory_by_thread_by_current_bytes 按线程分组的内存使用情况Memory use, grouped by thread
memory_by_user_by_current_bytes, x$memory_by_user_by_current_bytesmemory_by_user_by_current_bytes, x$memory_by_user_by_current_bytes 按用户分组的内存使用情况Memory use, grouped by user
memory_global_by_current_bytes, x$memory_global_by_current_bytesmemory_global_by_current_bytes, x$memory_global_by_current_bytes 按分配类型分组的内存使用情况Memory use, grouped by allocation type
memory_global_total, x$memory_global_totalmemory_global_total, x$memory_global_total 内存使用总量Total memory use
metricsmetrics 服务器指标Server metrics
processlist, x$processlistprocesslist, x$processlist 进程列表信息Processlist information
ps_check_lost_instrumentationps_check_lost_instrumentation 丢失了指标的变量Variables that have lost instruments
schema_auto_increment_columnsschema_auto_increment_columns AUTO_INCREMENT 列信息AUTO_INCREMENT column information
schema_index_statistics, x$schema_index_statisticsschema_index_statistics, x$schema_index_statistics 索引统计信息Index statistics
schema_object_overviewschema_object_overview 每个模式中的对象类型Types of objects within each schema
schema_redundant_indexesschema_redundant_indexes 重复或冗余的索引Duplicate or redundant indexes
schema_table_lock_waits, x$schema_table_lock_waitsschema_table_lock_waits, x$schema_table_lock_waits 等待元数据锁的会话Sessions waiting for metadata locks
schema_table_statistics, x$schema_table_statisticsschema_table_statistics, x$schema_table_statistics 表统计信息Table statistics
schema_table_statistics_with_buffer, x$schema_table_statistics_with_bufferschema_table_statistics_with_buffer, x$schema_table_statistics_with_buffer 表统计,包括 InnoDB 缓冲池统计Table statistics, including InnoDB buffer pool statistics
schema_tables_with_full_table_scans, x$schema_tables_with_full_table_scansschema_tables_with_full_table_scans, x$schema_tables_with_full_table_scans 正在进行全表扫描的表Tables being accessed with full scans
schema_unused_indexesschema_unused_indexes 未被使用的索引Indexes not in active use
session, x$sessionsession, x$session 用户会话的进程列表信息Processlist information for user sessions
session_ssl_statussession_ssl_status 连接 SSL 信息Connection SSL information
statement_analysis, x$statement_analysisstatement_analysis, x$statement_analysis 语句聚合统计Statement aggregate statistics
statements_with_errors_or_warnings, x$statements_with_errors_or_warningsstatements_with_errors_or_warnings, x$statements_with_errors_or_warnings 产生错误或警告的语句Statements that have produced errors or warnings
statements_with_full_table_scans, x$statements_with_full_table_scansstatements_with_full_table_scans, x$statements_with_full_table_scans 已经执行全表扫描的语句Statements that have done full table scans
statements_with_runtimes_in_95th_percentile, x$statements_with_runtimes_in_95th_percentilestatements_with_runtimes_in_95th_percentile, x$statements_with_runtimes_in_95th_percentile 平均运行时间最高的语句Statements with highest average runtime
statements_with_sorting, x$statements_with_sortingstatements_with_sorting, x$statements_with_sorting 执行了排序的语句Statements that performed sorts
statements_with_temp_tables, x$statements_with_temp_tablesstatements_with_temp_tables, x$statements_with_temp_tables 使用了临时表的语句Statements that used temporary tables
user_summary, x$user_summaryuser_summary, x$user_summary 用户语句和连接活动User statement and connection activity
user_summary_by_file_io, x$user_summary_by_file_iouser_summary_by_file_io, x$user_summary_by_file_io 按用户分组的文件 I/OFile I/O, grouped by user
user_summary_by_file_io_type, x$user_summary_by_file_io_typeuser_summary_by_file_io_type, x$user_summary_by_file_io_type 按用户和事件分组的文件 I/OFile I/O, grouped by user and event
user_summary_by_stages, x$user_summary_by_stagesuser_summary_by_stages, x$user_summary_by_stages 按用户分组的阶段事件Stage events, grouped by user
user_summary_by_statement_latency, x$user_summary_by_statement_latencyuser_summary_by_statement_latency, x$user_summary_by_statement_latency 按用户分组的语句统计Statement statistics, grouped by user
user_summary_by_statement_type, x$user_summary_by_statement_typeuser_summary_by_statement_type, x$user_summary_by_statement_type 按用户和语句分组的已执行语句Statements executed, grouped by user and statement
versionversion 当前 sys 模式和 MySQL 服务器版本Current sys schema and MySQL server versions 是Yes
wait_classes_global_by_avg_latency, x$wait_classes_global_by_avg_latencywait_classes_global_by_avg_latency, x$wait_classes_global_by_avg_latency 按事件类分组的等待类平均延迟Wait class average latency, grouped by event class
wait_classes_global_by_latency, x$wait_classes_global_by_latencywait_classes_global_by_latency, x$wait_classes_global_by_latency 按事件类分组的等待类总延迟Wait class total latency, grouped by event class
waits_by_host_by_latency, x$waits_by_host_by_latencywaits_by_host_by_latency, x$waits_by_host_by_latency 按主机和事件分组的等待事件Wait events, grouped by host and event
waits_by_user_by_latency, x$waits_by_user_by_latencywaits_by_user_by_latency, x$waits_by_user_by_latency 按用户和事件分组的等待事件Wait events, grouped by user and event
waits_global_by_latency, x$waits_global_by_latencywaits_global_by_latency, x$waits_global_by_latency 按事件分组的等待事件Wait events, grouped by event
x$ps_digest_95th_percentile_by_avg_usx$ps_digest_95th_percentile_by_avg_us 95 百分位视图的辅助视图Helper view for 95th-percentile views
x$ps_digest_avg_latency_distributionx$ps_digest_avg_latency_distribution 95 百分位视图的辅助视图Helper view for 95th-percentile views
x$ps_schema_table_statistics_iox$ps_schema_table_statistics_io 表统计视图的辅助视图Helper view for table-statistics views
x$schema_flattened_keysx$schema_flattened_keys schema_redundant_indexes 的辅助视图Helper view for schema_redundant_indexes

表 30.3 sys 模式存储过程Table 30.3 sys Schema Stored Procedures

过程名称Procedure Name 说明Description
create_synonym_db()create_synonym_db() 为模式创建同义词Create synonym for schema
diagnostics()diagnostics() 收集系统诊断信息Collect system diagnostic information
execute_prepared_stmt()execute_prepared_stmt() 执行预处理语句Execute prepared statement
ps_setup_disable_background_threads()ps_setup_disable_background_threads() 禁用后台线程检测Disable background thread instrumentation
ps_setup_disable_consumer()ps_setup_disable_consumer() 禁用消费者Disable consumers
ps_setup_disable_instrument()ps_setup_disable_instrument() 禁用仪器Disable instruments
ps_setup_disable_thread()ps_setup_disable_thread() 禁用线程的检测Disable instrumentation for thread
ps_setup_enable_background_threads()ps_setup_enable_background_threads() 启用后台线程检测Enable background thread instrumentation
ps_setup_enable_consumer()ps_setup_enable_consumer() 启用消费者Enable consumers
ps_setup_enable_instrument()ps_setup_enable_instrument() 启用仪器Enable instruments
ps_setup_enable_thread()ps_setup_enable_thread() 为线程启用检测Enable instrumentation for thread
ps_setup_reload_saved()ps_setup_reload_saved() 重新加载已保存的性能模式配置Reload saved Performance Schema configuration
ps_setup_reset_to_default()ps_setup_reset_to_default() 重置已保存的性能模式配置Reset saved Performance Schema configuration
ps_setup_save()ps_setup_save() 保存性能模式配置Save Performance Schema configuration
ps_setup_show_disabled()ps_setup_show_disabled() 显示已禁用的性能模式配置Display disabled Performance Schema configuration
ps_setup_show_disabled_consumers()ps_setup_show_disabled_consumers() 显示已禁用的 Performance Schema 消费者Display disabled Performance Schema consumers
ps_setup_show_disabled_instruments()ps_setup_show_disabled_instruments() 显示已禁用的 Performance Schema 工具Display disabled Performance Schema instruments
ps_setup_show_enabled()ps_setup_show_enabled() 显示已启用的 Performance Schema 配置Display enabled Performance Schema configuration
ps_setup_show_enabled_consumers()ps_setup_show_enabled_consumers() 显示已启用的性能模式消费者Display enabled Performance Schema consumers
ps_setup_show_enabled_instruments()ps_setup_show_enabled_instruments() 显示已启用的性能模式工具Display enabled Performance Schema instruments
ps_statement_avg_latency_histogram()ps_statement_avg_latency_histogram() 显示语句延迟直方图Display statement latency histogram
ps_trace_statement_digest()ps_trace_statement_digest() 跟踪消化的性能模式器监控Trace Performance Schema instrumentation for digest
ps_trace_thread()ps_trace_thread() 导出线程的性能模式数据Dump Performance Schema data for thread
ps_truncate_all_tables()ps_truncate_all_tables() 清空性能模式摘要表Truncate Performance Schema summary tables
statement_performance_analyzer()statement_performance_analyzer() 服务器上运行语句的报告Report of statements running on server
table_exists()table_exists() 表是否存在Whether a table exists

表 30.4 sys 架构存储函数Table 30.4 sys Schema Stored Functions

函数名称Function Name 说明Description 已弃用Deprecated
extract_schema_from_file_name()extract_schema_from_file_name() 从文件名中提取架构名称部分Extract schema name part of file name
extract_table_from_file_name()extract_table_from_file_name() 从文件名中提取表名部分Extract table name part of file name
format_bytes()format_bytes() 将字节数转换为带单位的数值Convert byte count to value with units 是Yes
format_path()format_path() 用符号系统变量名替换路径名中的目录Replace directories in path name with symbolic system variable names
format_statement()format_statement() 将长语句截断为固定长度Truncate long statement to fixed length
format_time()format_time() 将皮秒时间转换为带单位的值Convert picoseconds time to value with units 是Yes
list_add()list_add() 向列表中添加项目Add item to list
list_drop()list_drop() 从列表中移除项目Remove item from list
ps_is_account_enabled()ps_is_account_enabled() 账户的性能模式监控是否启用Whether Performance Schema instrumentation for account is enabled
ps_is_consumer_enabled()ps_is_consumer_enabled() 性能模式消费者是否启用Whether Performance Schema consumer is enabled
ps_is_instrument_default_enabled()ps_is_instrument_default_enabled() 性能模式监控是否默认启用Whether Performance Schema instrument is enabled by default
ps_is_instrument_default_timed()ps_is_instrument_default_timed() Performance Schema 工具默认是否计时Whether Performance Schema instrument is timed by default
ps_is_thread_instrumented()ps_is_thread_instrumented() 针对连接 ID 的 Performance Schema 仪表化是否已启用Whether Performance Schema instrumentation for connection ID is enabled
ps_thread_account()ps_thread_account() 与 Performance Schema 线程 ID 关联的账户Account associated with Performance Schema thread ID
ps_thread_id()ps_thread_id() 与连接 ID 关联的 Performance Schema 线程 IDPerformance Schema thread ID associated with connection ID 是Yes
ps_thread_stack()ps_thread_stack() 连接 ID 的事件信息Event information for connection ID
ps_thread_trx_info()ps_thread_trx_info() 线程 ID 的事务信息Transaction information for thread ID
quote_identifier()quote_identifier() 作为标识符的引用字符串Quote string as identifier
sys_get_config()sys_get_config() sys schema 配置选项值sys schema configuration option value
version_major()version_major() MySQL 服务器主版本号MySQL server major version number
version_minor()version_minor() MySQL 服务器小版本号MySQL server minor version number
version_patch()version_patch() MySQL 服务器补丁版本号MySQL server patch release version number