千家信息网

slow_launch_time和long_query_time

发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,1.slow_launch_timeCommand-Line Format--slow_launch_time=#System VariableNameslow_launch_timeVariable
千家信息网最后更新 2026年11月03日slow_launch_time和long_query_time

1.slow_launch_time

Command-Line Format--slow_launch_time=#
System VariableNameslow_launch_time
Variable ScopeGlobal
Dynamic VariableYes
Permitted ValuesTypeinteger
Default2

If creating a thread takes longer than this many seconds, the server increments the Slow_launch_threadsstatus variable.

如果创建线程需要比slow_launch_time更多的时间,服务器会增加 Slow_launch_threads的状态变量。

Slow_launch_threads

The number of threads that have taken more than slow_launch_time seconds to create.

创建时间超过slow_launch_time的线程个数。


2.long_query_time

Command-Line Format--long_query_time=#
System VariableNamelong_query_time
Variable ScopeGlobal, Session
Dynamic VariableYes
Permitted ValuesTypenumeric
Default10
Min Value0

If a query takes longer than this many seconds, the server increments the Slow_queries status variable. If the slow query log is enabled, the query is logged to the slow query log file. This value is measured in real time, not CPU time, so a query that is under the threshold on a lightly loaded system might be above the threshold on a heavily loaded one. The minimum and default values of long_query_time are 0 and 10, respectively. The value can be specified to a resolution of microseconds. For logging to a file, times are written including the microseconds part. For logging to tables, only integer times are written; the microseconds part is ignored.

如果查询需要比long_query_time更多的时间,服务器会增加slow_queries的状态变量。如果启用了慢查询日志,则查询将记录到慢查询日志文件中。此值是实时测量的,而不是中央处理器的时间,所以一个在轻负载系统的阈值下的查询可能会高于重负载的系统的阈值。最小值和默认值long_query_time分别为0和10。该值可以精确到微秒。如果记录到文件中,时间包括微秒部分。如果记录到表,只有整数部分;微秒部分被忽略。

Slow_queries

The number of queries that have taken more than long_query_time seconds. This counter increments regardless of whether the slow query log is enabled.

查询时间超过long_query_time 的查询数目,这个数值的增加与是否启动慢查询日志无关。


总结:从上面的内容可以看出,slow_launch_time和long_query_time虽然模样差不多,但是关系却没那么近。

查询 时间 日志 部分 变量 文件 更多 服务器 状态 系统 线程 阈值 服务 最小 精确 差不多 个数 中央 中央处理器 内容 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技公司的优势 互联网科技会 互联网科技开发公司 互联网金融与金融科技 齐家互联网科技有限公司 深圳卡尔迅互联网科技有限公司怎么样 互联网汽车科技小镇 欧洲十大科技互联网公司 金融科技与互联网金融相同和不同 南山科技园互联网公司有哪些 荆州市昕露互联网络科技有限公司 华夏互联网科技业 想开互联网科技公司怎么样 科技赋能视角下互联网保险发展 互联网科技公司营业执照怎么办理 山东子淼互联网科技有限公司 上海钢联属于互联网科技股吗 皮皮虾互联网科技有限公司 领航科技大厦互联网公司 卡尔迅互联网科技有限公司 中国互联网科技工作委员会毛军 智慧科技互联网 顺玮阁互联网科技 阿大互联网科技有限公司 西安小鹰速贷互联网科技有限公司 华中科技大学互联网的牛人 小米互联网科技园入驻 科技互联网行业投资研究 互联网大会出现的黑科技 互联网企业和网络科技有限公司
0