---
title: Query speed optimization (timeout)
slug: query-speed-optimization-timeout
docTags: 
createdAt: 2024-09-27T12:33:09.483Z
---

By default, all queries have timeout. If you have timeout error - try to implement speedup strategy.

We use clickhouse with partition by gen\_utime, shard, workchain.

1. Always use time filters: `gen_utime__gt` and `gen_utime__lt`, use your business logic to find the right numbers. Do not run search on all TON transactions
2. Use more filters. If you know that it's NFT item - use get method filter, for example. More filter = fewer results = faster search.
3. Use less columns - query not all columns in database, just only needed ones.



Or you can buy a paid grade with longer calculation time [here](https://t.me/dtontech_bot)

1. Omega: 2sec (same as free)
2. Gamma: 5sec
3. Beta: 10sec
4. Alpha: 15sec

