Why Is My SQL Query So Slow?
- 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.
To learn how to view RDS for PostgreSQL logs, see Viewing and Downloading Error Logs.
For RDS for SQL Server, you can query dynamic management views (DMVs) to locate the cause of slow queries. For details on DMVs, visit the Microsoft official website.
- View the CPU usage metric of your DB instance.
For details, see Viewing Performance Metrics.
- Create read replicas to offload read pressure on primary DB instances.
- When multiple associated tables are queried, indexes must be created for the associated fields.
- Do not use the SELECT statement to scan all tables. You can specify fields or add the WHERE condition.
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