# MySQL Query timeout config / Slow query

**URL:** <https://community.temporal.io/t/mysql-query-timeout-config-slow-query/12651>\
**Category:** Community Support\
**Tags:** mysql\
**Created:** [June 26, 2024, 4:34pm UTC](https://community.temporal.io/t/mysql-query-timeout-config-slow-query/12651 "2024-06-26T16:34:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirmal\_Balaji\_Packir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/nirmal_balaji_packir/32/5517_2.png) [@Nirmal\_Balaji\_Packir](https://community.temporal.io/u/Nirmal_Balaji_Packir)\
**Post date:** [June 26, 2024, 4:34pm UTC](https://community.temporal.io/t/mysql-query-timeout-config-slow-query/12651/1 "2024-06-26T16:34:25Z")

</div>

We are trying to set-up temporal with a MySQL instance which has the database that our application uses that holds customer data.

In the same instance, we have created a separate DB for temporal and temporal\_visiblity. We have disabled elastic search when we installed temporal.

**Load:** Currently we will have very few workflows but in the future we can have 100Ks of workflow a day that can run upto 20 minutes each.

In this setup,

1. is there a config like SQL timeout in temporal that can prevent slow queries so that temporal workflows need not fight for DB CPU/memory with our critical production applications?
2. Or is the only way to prevent this from happening is by have a low retention period in all namespaces, so that temporal and visibility DBs will have less data so that queries will be fast.
3. In #2, I am assuming that if the retention is set to, say, 7 days, temporal will automatically delete the completed workflows after 7 days without manual intervention. Please correct me if I am wrong
