# Query performance

## What you can do here

The Query Performance dashboard gives you insight into how your database queries are performing. You can identify slow queries, get AI-powered optimization suggestions, and view or terminate queries that are currently running.

## Performance alerts

### Needs Attention (500ms)

A query needs attention once the average execution time exceeds 500ms. This indicates performance is degrading and should be investigated.

### Critical (1000ms)

A query is critical once the average execution time exceeds 1000ms. This has a significant impact on application performance and user experience. Immediate action is required.

{% hint style="warning" %}
Queries flagged as Needs Attention should be investigated, and those flagged as Critical require immediate attention.
{% endhint %}

## Minimum query duration

Each Servoy Cloud environment has a default minimum query duration threshold set to 20ms. Queries faster than this threshold are not shown in the dashboard.

To change the minimum duration:

1. Go to Admin Settings
2. Click on the [Environment](/reference/servoy-cloud/cloud-control-center/administration/settings.md#environment) tab
3. Change the value of "Min query duration"
4. Save changes

## ServoyAI Query Analyzer

The AI can analyze slow queries and suggest optimizations. To use the analyzer:

1. Navigate to the Query Performance dashboard from the Environment Details overview
2. Click the **Show more** button on the query you want to analyze
3. Click the ServoyAI icon
4. Read and accept the [Servoy Cloud Privacy policy](/reference/servoy-cloud/privacy-policy-servoyai.md#servoyai)
5. Request suggestions

When creating a support ticket from a query analysis, the SQL query is automatically included so you don't have to copy it manually.

## Running Queries

The Running Queries tab shows all database queries that are currently being executed in your environment. This lets you spot long-running or stuck queries and terminate them if needed — without needing access to the database directly.

**Where to find it:** Environments > \[Environment Name] > Query Performance > **Running Queries**

From this view you can:

* See all active queries with execution details, timing, and the user that triggered them
* Hover over a truncated query to see the full SQL
* Click the refresh icon to update the list
* Click the X icon next to a query to terminate it immediately

Only users with the right permissions can view and terminate queries.

<figure><img src="/files/YJonsBuDf5c4Om7Y4ctN" alt="Servoy Cloud Control Center showing the Running Queries view with active database queries, timing, and terminate options"><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.servoy.com/reference/servoy-cloud/cloud-control-center/application-overview/applications/environments/metrics/query-performance.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.
