MySQL Status Performance_schema_program_lost 数据库状态作用意思及如何正确

本站中文解释

_total

MySQL status 变量是 MySQL 中用于记录系统信息的变量,它们可以显示 MySQL 服务器的运行情况、性能,以及其他统计信息等。总的来说,MySQL status 变量用于及时显示和分析系统运行情况,提升系统运行效率。

Performance_schema_program_lost_total 变量是 MySQL 中循环执行计划丢失计算总和的统计状态变量,是在Performance_schema统计中的表中用于计算总循环执行次数。Tencent Cloud云开发者大会

通过配置Performance_schema_program_lost_total 设定MySQL内置参数来更新统计数据,从而实时反应系统运行情况,大量性能分析会用 Performance_schema_program_lost_total 来作为计算统计的基本指标。

设置Performance_schema_program_lost_total 变量的方法大致有两种:

第一种方法:在初始化MySQL时,可以在my.cnf配置文件中加入performance_schema_program_lost_total变量的配置。比如,下面的例子中配置的变量可以设置为1。

[mysqld]
performance_schema_program_lost_total=1

第二种方法:可以在使用SET GLOBAL来设置MySQL状态变量,比如可以把performance_schema_program_lost_total变量设置为2:

SET GLOBAL performance_schema_program_lost_total=2;

以上两种方法都可以让MySQL识别到Performance_schema_program_lost_total变量并能完成设定,但总的来说,单独设置Performance_schema_program_lost_total变量可能会造成性能不稳定,所以我们建议一起设置其它performance_schema变量,这样可以避免性能问题的出现。


数据运维技术 » MySQL Status Performance_schema_program_lost 数据库状态作用意思及如何正确