---
title: "MySQL slow query logs"
date: "2024-02-14T06:18:38+00:00"
summary: "Optimize your website's performance by analyzing MySQL slow query logs. Learn how to download, interpret, and use these logs to identify and resolve database-related issues affecting your site's speed and efficiency."
image:
type: "page"
url: "/acquia-cloud-platform/mysql-slow-query-logs"
id: "004f43ad-6231-4304-8b17-0b9607391087"
---

You can download your website’s MySQL slow query logs from the **Logs** page in the Cloud Platform user interface. By analyzing the slow query log, you can identify database-related issues that may be impairing your website’s performance. Slow queries are database queries that took longer than one second.

To download the MySQL slow query log for an environment:

1.  [Sign in to the Cloud Platform user interface](/node/55875) and select your application and environment.
2.  In the left menu, click **Logs**.
    
    ![cloud-platform_downloading-slow-query.png](https://acquia.widen.net/content/b074949d-9d31-46cc-9f69-9e664c40abcf/web/cloud-platform_downloading-slow-query.png)
    
3.  From the **Download** tab, in the **MySQL slow query** log line, click **Download**.
    
    Note
    
    On most browsers, the download begins immediately. If it doesn’t, the system displays a pop-up window with the download URL. You can copy and paste the URL in a new window to initiate the download manually.
    

Cloud Platform generates the slow query log. The slow query log includes data generated since the last time the MySQL log was rotated, which occurs daily. It should begin downloading as soon as it is generated, with a file name of the form: `slow_query_log_[sitename]_[timestamp:1349352001].sql`

A slow query log is generated on demand; unlike other logs on the Acquia platform, slow query logs aren’t retained and can be accessed only by using the **Download** button. The slow query logs are visible only for the primary database server and not for the secondary database server.

You can examine the slow query log using tools like Percona Tools [pt-query-digest](http://www.percona.com/doc/percona-toolkit/2.1/pt-query-digest.html) and the MySQL EXPLAIN statement. For more information, see [Tools for parsing a slow query log](/acquia-cloud-platform/help/93206-tools-parsing-slow-query-log "Tools for parsing a slow query log").

For another approach to identifying resource consumption issues and bottlenecks, consider [using an application monitoring tool](/acquia-cloud-platform/monitor-apps/apm), such as New Relic.

Related topics
--------------

*   [Tools for parsing a slow query log](/acquia-cloud-platform/help/93206-tools-parsing-slow-query-log "Tools for parsing a slow query log")
*   [About Cloud Platform logging](/acquia-cloud-platform/monitor-apps/logs)
*   [Improving application performance](/acquia-cloud-platform/performance)