文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 29 MySQL Performance Schema / 29.4 Performance Schema Runtime Configuration / 29.4.9 Naming Instruments or Consumers for Filtering Operations
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

29.4.9 为过滤操作命名仪器或消费者29.4.9 Naming Instruments or Consumers for Filtering Operations

用于过滤操作的名称可以根据需要指定得具体或通用。要表示单个仪器或消费者,请完整指定其名称:Names given for filtering operations can be as specific or general as required. To indicate a single instrument or consumer, specify its name in full:

UPDATE performance_schema.setup_instruments
SET ENABLED = 'NO'
WHERE NAME = 'wait/synch/mutex/myisammrg/MYRG_INFO::mutex';

UPDATE performance_schema.setup_consumers
SET ENABLED = 'NO'
WHERE NAME = 'events_waits_current';

要指定一组仪器或消费者,请使用匹配组成员的模式:To specify a group of instruments or consumers, use a pattern that matches the group members:

UPDATE performance_schema.setup_instruments
SET ENABLED = 'NO'
WHERE NAME LIKE 'wait/synch/mutex/%';

UPDATE performance_schema.setup_consumers
SET ENABLED = 'NO'
WHERE NAME LIKE '%history%';

如果使用模式,应选择匹配所有感兴趣项目且不匹配其他项目的模式。例如,要选择所有文件 I/O 仪器,最好使用包含整个仪器名称前缀的模式:If you use a pattern, it should be chosen so that it matches all the items of interest and no others. For example, to select all file I/O instruments, it is better to use a pattern that includes the entire instrument name prefix:

... WHERE NAME LIKE 'wait/io/file/%';

模式 '%/file/%' 会匹配名称中任何位置包含 '/file/' 元素的其他仪器。更不合适的是模式 '%file%',因为它会匹配名称中任何位置包含 'file' 的仪器,例如 wait/synch/mutex/innodb/file_open_mutex。A pattern of '%/file/%' matches other instruments that have an element of '/file/' anywhere in the name. Even less suitable is the pattern '%file%' because it matches instruments with 'file' anywhere in the name, such as wait/synch/mutex/innodb/file_open_mutex.

要检查某个模式匹配哪些仪器或消费者名称,请执行一个简单的测试:To check which instrument or consumer names a pattern matches, perform a simple test:

SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE 'pattern';

SELECT NAME FROM performance_schema.setup_consumers
WHERE NAME LIKE 'pattern';

有关支持的名称类型的信息,请参见 29.6 节,“性能模式仪器命名约定”。For information about the types of names that are supported, see Section 29.6, “Performance Schema Instrument Naming Conventions”.