GitHub user dosubot[bot] added a comment to the discussion: Problems with 
infinite number of query statements being called from charts causing DB failures

<!-- Answer -->
I found some similar threads that might be relevant to your situation:

1. [boot superset](https://github.com/apache/superset/discussions/31744) - This 
discussion is open and unsolved 
<sup>[[1]](https://github.com/apache/superset/discussions/31744)</sup>.
2. [Timeout Issue with Charts on Athena Data 
Source](https://github.com/apache/superset/discussions/23177) - This discussion 
is open and unsolved 
<sup>[[2]](https://github.com/apache/superset/discussions/23177)</sup>.

Regarding your questions:

**Q1:** Superset can handle long-running queries using an asynchronous backend 
configured with Celery. This setup includes Superset workers, a Celery broker 
(such as Redis or RabbitMQ), and a results backend. You can also set a timeout 
for queries using the `SQLLAB_TIMEOUT` setting in the configuration to prevent 
them from running indefinitely. For example:

```python
SQLLAB_TIMEOUT = 1800
```

This setting helps manage query execution and prevent database failures due to 
prolonged query execution 
<sup>[[3]](https://github.com/apache/superset/blob/master/docs/docs/configuration/async-queries-celery.mdx)</sup><sup>[[4]](https://github.com/apache/superset/issues/33218)</sup>.

**Q2:** For dashboards with large data tables, it is recommended to optimize 
database performance by adding appropriate indexes. This ensures that queries 
execute quickly and efficiently. Additionally, consider using views or 
pre-aggregated tables to reduce the need for complex joins and transformations 
at query time 
<sup>[[5]](https://github.com/apache/superset/blob/master/docs/docs/faq.mdx)</sup><sup>[[6]](https://github.com/apache/superset/discussions/32343)</sup>.

**Q3:** Unfortunately, I couldn't find specific information on changes or 
improvements in Superset versions 4 and 5 regarding query handling and 
performance optimization. It might be worth checking the release notes or 
documentation for these versions for any updates related to your issue.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/37af774e-92d3-4dda-b4d2-38b14bd55100?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33342#discussioncomment-13009774

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to