【问题标题】:mysql-slow.log displays 'information_schema' queries when 'log-queries-not-using-indexes' is enabledmysql-slow.log 在启用“log-queries-not-using-indexes”时显示“information_schema”查询
【发布时间】:2019-11-23 16:12:02
【问题描述】:

我在 /etc/my.cnf 中启用了log-queries-not-using-indexes

我现在可以看到没有索引的查询,但问题是我的日志中充满了这样的查询:

从 INFORMATION_SCHEMA.COLLATIONS WHERE 中选择 CHARACTER_SET_NAME COLLATION_NAME = 'utf8_general_ci';

从 INFORMATION_SCHEMA.COLLATIONS WHERE 中选择 CHARACTER_SET_NAME COLLATION_NAME = 'utf8mb4_bin';

我知道在这个数据库“information_schema”上进行更改是个坏主意,那么如何避免在我的日志中出现这些查询?

【问题讨论】:

    标签: mysql indexing mariadb mysql-slow-query-log


    【解决方案1】:
    • 在我看来,log_queries_not_using_indexes 几乎没用。它在开发过程中有一些短暂的用途,但在生产中却是噪音。
    • information_schema,至少在 8.0 之前,没有索引,也不是“真正的”表。
    • 您为什么经常联系information_schema?看看您是否可以减少此类呼叫的数量。

    【讨论】:

    • information_schema 由系统调用,而不是由我的脚本调用。可能是因为 cPanel 操作系统,不确定。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-07
    • 2022-12-02
    • 1970-01-01
    • 2023-04-09
    • 2016-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多