Use a slow query log

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 2분
  • Administrators can use slow query logs to gain insight into how queries are affecting platform performance. The Slow Queries log aggregates data for similar queries. Use slow query data to evaluate the need for new indexes, changes to existing indexes, or changes to frequent queries.

    시작하기 전에

    Role required: admin

    이 태스크 정보

    Queries are similar when they select from the same table and query the same field in the where clause, but search for different values in the field. For example, these queries are aggregated as similar queries.

    SELECT * FROM sys_user WHERE name="ITIL User"
    SELECT * FROM sys_user WHERE name="System Administrator"

    Aggregating similar query data allows administrators to monitor the performance impact of slow queries and of queries that occur frequently. The log reports data for similar queries where the total execution time exceeds 5 seconds.

    프로시저

    1. Navigate to All > System Diagnostics > Stats > Slow Queries
    2. Open a query record for more details.

      For a description of the field values in the query record, see Query record form fields.

    3. To see what the database is doing to retrieve the data, click Explain Plan.
      The query plan is reported in the MySQL Explain Plan related list. Use the query plan to evaluate the need for new indexes or changes to existing indexes. For more information, see MySQL explain plan documentation.

      This feature works on other supported databases, including MongoDB and Oracle.

    4. To generate an index suggestion for a slow query, click Index Suggestion.