- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有一个 MySQL CLI 命令
SHOW STATUS LIKE 'Last_query_cost';
但是如何使用简单的 SELECT 查询获取该信息?
是否有任何类型的转义/包装 MySQL CLI 命令以便它可以在普通 SELECT 语句中使用?
也许我可以使用 SELECT 查询一个模式,以获取 SHOW STATUS LIKE 'Last_query_cost';
命令提供的信息?
最佳答案
在 mysql v5.7 及更早版本中,所有全局变量和 session 变量都存储在 INFORMATION_SCHEMA
GLOBAL_STATUS
和 SESSION_STATUS
表中。
作为mysql manual说:
The GLOBAL_STATUS and SESSION_STATUS tables provide information about server status variables. Their contents correspond to the information produced by the SHOW GLOBAL STATUS and SHOW SESSION STATUS statements.
在 mysql v8 中,这些表被移动到 performance
模式,参见 mysql manual .
关于MySQL 8 Select语句得到 'Last_query_cost',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58581461/
当尝试查找复杂查询(其中包含子查询)的成本时,我得到的值为 0。 mysql's manual says : "The Last_query_cost value can be computed ac
有一个 MySQL CLI 命令 SHOW STATUS LIKE 'Last_query_cost'; 但是如何使用简单的 SELECT 查询获取该信息? 是否有任何类型的转义/包装 MySQL C
在进行查询优化时,SHOW STATUS 查询返回的值通过一些实践和解释很容易理解。 但是 last_query_cost 是晦涩难懂的,而且文档也很少。 唯一解释的是,它必须被解读为一种反男子气概的
我是一名优秀的程序员,十分优秀!