# Suboptimal Query Timeout Configuration

Canonical: https://www.pointfive.co/efficiency-hub/inefficiencies/suboptimal-query-timeout-configuration

[Cloud Efficiency Hub](https://www.pointfive.co/efficiency-hub) 

# Suboptimal Query Timeout Configuration

## Explanation

If no appropriate query timeout is configured, inefficient or runaway queries can execute for extended periods (up to the default 2-day system limit). For as long as the query is running, the warehouse will remain active and accrue costs. Proper timeout settings help terminate inefficient queries, free up compute capacity, and allow the warehouse to become idle sooner, making it eligible for auto-suspend once the inactivity timer is reached.

## Relevant Billing Model

## Detection

- Review account-level query timeout settings to confirm if a global policy shorter than the default is enforced

- Identify warehouses with no customized query timeout configured for workloads requiring exceptions

- Evaluate historical query run durations to detect unusually long-running queries that could benefit from timeout enforcement

- Validate with application owners whether specific workloads legitimately require extended query durations before setting tighter policies

## Remediation

- Configure a conservative account-level query timeout policy to limit maximum query execution times (e.g., 4-12 hours based on environment needs).

- Apply customized warehouse-level or user-level timeout policies for workloads that genuinely require longer execution windows.

- Regularly review and adjust query timeout settings as workload patterns evolve.

- Coordinate changes with data engineering teams to avoid unintended interruption of legitimate long-running jobs.

- Setup anomaly detection on long running queries

## Relevant Documentation

- [Query Cost Attribution](https://docs.snowflake.com/en/sql-reference/account-usage/query_attribution_history)

- [Query History](https://docs.snowflake.com/en/sql-reference/functions/query_history)

[Submit Feedback](https://hub.pointfive.co/inefficiencies/suboptimal-query-timeout-configuration)

## At a glance

Reference

CER-0129

Cloud provider

Snowflake

Service

Snowflake Virtual Warehouse

Category

[Compute](https://www.pointfive.co/efficiency-hub/service-category/compute)

Inefficiency type

Suboptimal Configuration

## Contributed by

- Simar Arora 

### Simar Arora

Value Engineer - FinOps @ Snowflake

[LinkedIn](https://www.linkedin.com/in/simarpreet-arora/)

---
Source: the public page above. Product screenshots and illustrative interfaces are examples, not live customer data.

