Is there any option to terminate queries which are taking too long time to excute grafana

In grafana we are facing issues like queries taking too long time to excute. So please let me know how can we terminate the queries or automatically stop the queries to excute if it is taking much longer time to excute.

@sravanisurapureddy48 which version of grafana are you using? It looks like version 8.3.4 introduced a feature to cancel the backend query when the query is canceled in grafana using the cancel query button:

Postgres/MySQL/MSSQL: Cancel in-flight SQL query if user cancels query in grafana