Doris Slow Query Management and Analysis
There are two tabs on the Slow Query Management page: Ongoing Slow Queries and Completed Queries. By default, ongoing slow queries whose latency exceeds 500 ms in the cluster are displayed. You can manually determine whether to terminate running SQL queries. Doris' slow query function diagnoses and analyzes the query records submitted by users. It not only records the SQL statements submitted by users, but also analyzes slow queries. You can focus on long-running SQL statements and optimize them to improve query efficiency.
Querying Ongoing Slow SQL Statements
- Log in to the CloudTable console.
- Click the name of the target cluster to access its details page. In the navigation pane, choose Slow Query Management > Ongoing Slow Queries.
- Use filter criteria such as the latency, time range, and SQL statement to quickly find out or kill the desired slow queries.
Table 1 Ongoing slow query parameters Parameter
Description
Query ID
ID of each SQL command
Start Time
Time when the SQL statement starts to be executed
End Time
Time when the SQL statement execution ends
Database
Database where the data table is located
SQL Statement
Ongoing SQL statement
Latency (ms)
SQL execution duration. Unit: ms
Status
SQL status
Operation
Operation for killing the query
Table 2 Slow query filter conditions Condition
Description
Slow query duration
Enter a filter value as required. The value cannot be less than 10 ms. You can also select 15 minutes, 30 minutes, or 1 hour on the console.
Slow query running date
Enter a date and time range for filtering as required.
Query by SQL
Filters slow queries based on SQL statements.
Querying Completed Slow SQL Statements
- Log in to the CloudTable console.
- Click the name of the target cluster to access its details page. In the navigation pane, choose Slow Query Management > Completed Queries.
- Use filter criteria such as the latency, time range, status, and SQL statement to quickly find out the desired slow queries.
Table 3 Completed slow query parameters Parameter
Description
Query ID
ID of each SQL command
Start Time
Time when the SQL statement starts to be executed
End Time
Time when the SQL statement execution ends
Database
Queried database
SQL Statement
Completed SQL statement
Latency (ms)
SQL execution duration
Status
SQL status, including FINISHED and CANCELLED.
Slow SQL Query Statuses
The slow SQL query statuses include FINISHED, RUNNING, or CANCELLED. When the status is RUNNING, Kill Query is displayed in the Operation column.
Status | Description |
|---|---|
FINISHED | The SQL statement has been executed. |
RUNNING | The SQL statement is running. You can determine whether to stop it. |
CANCELLED | The execution of the SQL statement is canceled. |
Doris Slow Query Commands
- Check whether the slow query function is enabled.
ADMIN show FRONTEND CONFIG like 'query_history_enable';
- Enable the slow query function.
ADMIN set FRONTEND CONFIG ("query_history_enable" = "true"); - Disable the slow query function.
ADMIN set FRONTEND CONFIG ("query_history_enable" = "false");
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
