Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 从不同的TIDB节点查询INFORMATION_SCHEMA.SLOW_QUERY表中数据,结果不一致
TiDB version is 5.1.0
Question:
Whether using Navicat, mysql-cli, or Python’s MySQL module, querying the following SQL from the 4000 port of two TiDB nodes returns inconsistent results.
The SQL is:
SELECT
DB AS ‘Database’,
Query_time AS ‘Execution Time’,
Total_keys AS ‘Total Keys Scanned’,
CONCAT( ‘'’, Time ) AS ‘Execution Time’,
USER AS ‘User’,
HOST AS ‘Host’,
QUERY AS ‘SQL Query’
FROM
INFORMATION_SCHEMA.SLOW_QUERY
WHERE
Query_time >= ‘10’
AND DATE_SUB( ‘2022-09-21 11:36:37.628878’, INTERVAL 7 DAY ) <= ‘2022-09-21 11:36:37.628878’
ORDER BY
Query_time DESC
LIMIT 1000;