Governance and guardrails
Guardrails stop one heavy query or script from slowing everything down. They apply across SQL Lab, charts, dashboards and Python Lab. Find them under Settings → Governance & Guardrails.
Query timeouts and row limits
- Statement Timeout Limit
- The longest a query may run, in seconds, before it's cancelled: 1 to 3,600. It's enforced on the database session itself (for example statement_timeout on PostgreSQL, MAX_EXECUTION_TIME on MySQL), so the database stops the work too.
- Maximum Row Return Limit
- The most rows a single query may return, to protect browsers and servers. When it's off, each dataset's and engine's own limits apply.
A query that hits the timeout stops with a message saying so. One that would return more rows than the limit returns the first rows up to the limit, and SQL Lab notes that pages are limited.
Python Lab limits
- Execution Timeout (seconds)
- How long one run may take.
- Memory Ceiling (MB)
- How much memory one run may use.
- Max Result Rows
- The most rows a result may have.
Python Lab shows the current limits under the editor, so people know before they run. See Sandbox limits.
How long history is kept
- Query History Retention (days)
- How long Query History keeps entries.
- Audit Log Retention (days)
- How long the audit log keeps entries.
- Import Version Retention
- How many earlier snapshots of each imported dataset are kept.
Choosing values
A reasonable start
- A statement timeout of 30 to 120 seconds suits most dashboards; analysts running heavy SQL may need more.
- A row limit of tens of thousands keeps the browser responsive; exports of more rows page through the data anyway.
- Keep the audit log for as long as your security or compliance policy requires.