# Diagnostics

Speedy's diagnostics help reveal potential bottlenecks in your template code. The total queries executed and the processing time for each `{exp:speedy:fragment}` and `{exp:speedy:static}` tag will be recorded and made available through Speedy's control panel settings page for future inspection. Caching may help hide slow performing pages, but the captured diagnostics can be used to help you identify and optimize bottlenecks.

You can disable diagnostics entirely by adding this to your config file:

```php
$config['speedy_diagnostics_enabled'] = 'no';
```

If you want a detailed list of all queries performed in each cache item you can add this to your config file. By default the diganostics will only record the key, query count, and execution time.

```php
$config['speedy_diagnostics_save_queries'] = 'yes';
```

<figure><img src="/files/FptsHLfJCuKPhkDhXnKb" alt=""><figcaption></figcaption></figure>

Viewing the diagnostics detail will list out all of the queries, along with their execution time, performed while generating that cache item. Run the queries individually in an external tool such as MySQL Workbench or Sequel Ace to further analyze the query.

<figure><img src="/files/2au1oFgucjZTtMuDjGgE" alt=""><figcaption></figcaption></figure>

There is even a home page widget listing out the top 10 slowest cache items.

<figure><img src="/files/ZGNL9KJnkLsrF6wL9LvC" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.boldminded.com/speedy/docs/diagnostics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
