All Products
Search
Document Center

Find full table scan SQL statements in a tenant

Last Updated: Jun 18, 2021

You can run 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' |
+-------------------------------+