云数据库OceanBase入门教程 OceanBase 查找某个租户中执行全表扫描的 SQL

2024-02-26 开发教程 云数据库OceanBase入门教程 匿名 4

运行如下语句可以查询某个租户中执行全表扫描的 SQL:

obclient>SELECT query_sql
FROM oceanbase.gv$sql_audit
WHERE table_scan = 1 AND tenant_id = 1001
GROUP BY sql_id;
+-------------------------------+
| query_sql |
+-------------------------------+
| SHOW VARIABLES LIKE 'version' |
+-------------------------------+