Updated on 2025-06-13 GMT+08:00

Why Is My SQL Query So Slow?

  1. You can view the slow SQL logs for slow SQL queries and view their performance characteristics (if any) to locate the cause.

    To learn how to view RDS for MySQL logs, see Viewing and Downloading Slow Query Logs.

  2. View the CPU usage metric of your DB instance.

    For details, see Viewing Performance Metrics of a DB Instance.

  3. Create read replicas to offload read pressure on primary DB instances.
  4. When multiple associated tables are queried, indexes must be created for the associated fields.
  5. Do not use the SELECT statement to scan all tables. You can specify fields or add the WHERE condition.