SQL Explorer

更新时间:
复制 MD 格式

SQL Explorer helps you assess the health of SQL queries, troubleshoot performance issues, and analyze business traffic. This streamlines fault diagnosis, database optimization, and risk detection.

Note

SQL Explorer is enabled by default on PolarDB for MySQL clusters on Edge Node Service (ENS). The logging component collects full SQL details and retains them for 14 days by default.

Procedure

  1. Log on to the PolarDB for ENS console.

  2. Find the target cluster and click its cluster ID.

  3. In the left navigation pane, choose SQL Explorer.

The SQL Explorer page offers filters such as Time Range, Keyword (supports fuzzy search for SQL statements), Database Name, Database User, and Client IP. After setting these filters, click Search to retrieve SQL records. The results are displayed in a table with columns for SQL Statement, Database, Process ID, User, Client IP, Client Port, Duration (μs), Rows Scanned, Rows Updated, Execution Time, and Actions. Click Details in the Actions column to view the details of a specific SQL record.

Features

SQL Explorer supports multi-dimensional search. Each search returns up to 1,000 matching SQL records. For more precise results, use more specific search criteria.

Parameter

Description

Keyword search

Searches for keywords within SQL statements. You can enter multiple keywords separated by spaces.

Note

Keywords must be complete tokens. For example, "INSER" returns no results, while "INSERT" does.

Database Name

Filters by the database on which the SQL statement was executed.

Database User

Filters by the user who executed the SQL statement.

Client IP

Filters by the client IP address from which the SQL statement was executed.

Note

In ENS, when requests are sent through a connection address, the client IP resolves to the IP address of the load balancer.

Usage notes

  • If an SQL statement is too long, it is truncated in the results list. You can view the full, formatted SQL in the details panel.

    In the Actions column of an SQL record, click Details.

    The Details dialog box displays basic information, including the database, process ID, user, client IP, client port, duration (μs), rows scanned, rows updated, and execution time. The SQL Statement section below displays the full, untruncated SQL text.