# Indexing & query tuning

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Data & storage area: DB, cache, queues.

Page: https://gradus.kazet.blog/tree/cloud-application/step/indexing-and-query-tuning

Find the slow queries, add the indexes they need and keep a query plan check in the test suite.

Usually comes after: [Data access layer & seed data](https://gradus.kazet.blog/tree/cloud-application/step/data-access-layer).

Leads to: [Full-text search](https://gradus.kazet.blog/tree/cloud-application/step/full-text-search).

## Prompt for your AI assistant

```
Identify the slowest database queries using the query log or EXPLAIN, add the indexes they need and add a test that fails if a critical query starts doing a sequential scan.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
