Title: Slow Query Logs
Author: WordPress VIP Documentation
Published: June 8, 2023
Last modified: March 12, 2026

---

 1. [Logs](https://docs.wpvip.com/logs/)
 2. Slow Query Logs

#  Slow Query Logs

Slow query logs provide the ability to identify database queries made by an application
that take an unusually long time to execute — specifically, any query that takes**
0.75s or longer**. Slow queries should be optimized in order to improve database
efficiency and the overall responsiveness of an application.

Logs for up to 100 of the most recent slow queries that have occurred on an environment
can be accessed:

 * In the **Slow Query Logs** panel located in [the application view of the VIP Dashboard](https://docs.wpvip.com/vip-dashboard/application-view/).
 * In the command line using [the VIP-CLI command `vip slowlogs`](https://docs.wpvip.com/vip-cli/commands/slowlogs/).

Details related to each slow query are provided to assist customers with investigating
the source of a slow query and improve its performance.

**Note**

Slow query logs for an environment can also be shipped to a cloud storage bucket
on a regular cadence by [configuring and enabling Log Shipping](https://docs.wpvip.com/logs/log-shipping/).

## Access

**Prerequisite**

 * To access **Slow Query Logs** in the VIP Dashboard or with VIP-CLI, a user must
   have at minimum an [Org member role](https://docs.wpvip.com/manage-user-access/vip-dashboard/org-roles)
   or an [App write role](https://docs.wpvip.com/manage-user-access/vip-dashboard/org-roles/#h-app-roles)
   for that application.
 * For users with an App write role, sensitive data is obfuscated with `?` characters.

To access the **Slow Query Logs** panel in the VIP Dashboard:

 1. Navigate to the [VIP Dashboard](https://dashboard.wpvip.com/) for an application.
 2. Select “**Logs**” from the sidebar navigation at the left of the screen.
 3. Select **“Slow Query”** from the submenu.

The **Slow Query Logs** panel is environment-specific (e.g., production, develop).
A different environment can be selected from the dropdown at the upper left of the
VIP Dashboard application view.

## Information displayed

Slow queries are listed in order of the most to the least recent. Information related
to each slow query is displayed across 3 columns.

 * **Time (UTC)**: The timestamp in UTC when the slow query occurred.
 * **Duration**: The statement execution time in seconds.
 * **SQL**: The SQL statement that triggered the slow query.
    - **Request URL:** The URL on which the slow query occurred.
    - **Rows sent:** The number of rows sent to the client.
    - **Rows examined:** The number of rows examined by the server layer.

## Filter logs

The displayed logs can be filtered by searching for specific strings. Enter a value
to filter by in the search field located in the upper right of the panel labeled“**
Search form**“.

## Export logs as a CSV

 * VIP Dashboard
 * VIP-CLI

In the VIP Dashboard, export a copy of the displayed logs as a CSV file by selecting
the button labeled “**Download as CSV**” located in the upper right of the panel.
If the displayed logs are filtered by a search term, only the filtered results will
be included in the downloaded CSV file.

In VIP-CLI, specify slow query logs to be output in CSV format by passing the `--
format=csv` option with [the `vip slowlogs` command](https://docs.wpvip.com/vip-cli/commands/slowlogs/).
For example:

    ```wp-block-preformatted
    $ vip @example-app.develop slowlogs --format=csv
    ```

## Debugging resources

Underlying causes for slow queries might not be immediately apparent, and more in-
depth debugging may be needed. Stack traces for the provided **Request URL** value
of a slow query can be reviewed by [viewing the URL in a browser window with Query Monitor enabled](https://docs.wpvip.com/query-monitor/#2-queries).
The Queries panel available in Query Monitor can provide detailed information about
the Query, Caller, and Time elapsed for execution for each SQL query sent to the
database by the current page.

Last updated: March 12, 2026