In Hologres V0.10 and later, you can query and analyze slow query logs to diagnose, analyze, and take optimization measures for slow queries or failed queries. This topic describes how to query and analyze slow query logs in a visualized manner.
Limits
- This feature is supported only by Hologres V0.10 and later. You can check the version of your Hologres instance on the instance details page in the Hologres console. If the version of your Hologres instance is earlier than V0.10, submit a ticket to update your instance.
- To ensure system stability and prevent traffic overloads, a maximum of 2,000 slow query logs can be returned each time.
- The maximum time range in which slow query logs can be queried in the HoloWeb console is seven days.
Query slow query logs
View the trend of slow queries or failed queries and the slow query logs that meet the filter conditions
- Trend of slow queries or failed queries
- View the trend of slow queries or failed queries before and after a specific point
in time.
Click a specific point in time in the trend chart to view the trend of slow queries or failed queries within 10 seconds before and after the point in time.
- View the trend of slow queries or failed queries within a time range.
Select a time range in the trend chart to view the trend of slow queries or failed queries within the selected time range.
- View the trend of slow queries or failed queries before and after a specific point
in time.
- Slow query logs that meet the filter conditions
- View the slow query logs that meet the filter conditions.
The following table describes the default fields.
Field Description User ID The account ID of the user who executed the SQL statement. Database The name of the database whose data is queried. Type The type of the SQL statement used in the query. Query The statement used in the query. You can click the statement to view the details of the statement. Status The status of the query. Valid values: Succeeded and Failed. Start Time The start time of the query. Duration The total execution duration of the query, including the optimization duration, the startup duration of the query, and the duration for returning the query result. Read Bytes The number of bytes read by the query. Operation By default, Details is displayed. - Click Details to go to the details page of the query. Then, you can view the details of the query, including the basic information, such as the database whose data is queried and the ID of the query, advanced information, total execution duration, and startup duration. You can also optimize the SQL statement. For more information, see Optimize the performance of internal table queries.
- Click the
icon to the right of Details to open a new SQL editor for the query.
- View other fields.
If the default fields cannot meet your requirements, click Customize Columns in the upper-right corner of the Queries section. In the dialog box that appears, select more fields to display.
- View the Gantt chart.
HoloWeb supports Gantt charts. To view the Gantt chart of queries, you can click View Gantt Chart in the upper-right corner of the Queries section. In the dialog box that appears, you can view the execution status of queries that are concurrently executed within a specified time range. This helps you to identify performance bottlenecks of concurrently-executed queries.
- View the slow query logs that meet the filter conditions.