Find full table scan SQL statements in a tenant

2023-10-24 09:23:03  Updated

You can execute the following statement to find SQL statements that executed full table scans in a tenant:

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' |
+-------------------------------+

Contact Us