---
title: "Keep analytics queries off the production · Agent Wranglers"
url: https://agentwranglers.se/playbook/data-engineering/warehouse-and-models/separate-warehouse
id: DEN-1
level: Recommended
updated: 2026-10-22
tokens: 680
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep analytics queries off the production database

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Warehouse and models](https://agentwranglers.se/playbook/data-engineering/warehouse-and-models.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: DEN-1
- Level: Recommended
- Chapter: [Warehouse and models](https://agentwranglers.se/playbook/data-engineering/warehouse-and-models.md)
- Rule: Run reports, dashboards and analysis against a warehouse or a read replica, never against the primary database the app writes to.
- Check: The users on the primary database include no BI tool, notebook or analyst account. A listing of sessions on the primary over 7 days shows none from a reporting tool.
- How: One heavy report can take the CPU, connections or locks the app needs. A small app can start with a read replica when its reports accept the lag, as [Read from replicas only what may lag](https://agentwranglers.se/playbook/data/caches-and-copies/replica-lag.md) says. Move to a separate warehouse once reports join data from two or more systems. The app database stays the source of truth, as [Name the source of truth](https://agentwranglers.se/playbook/data/caches-and-copies/source-of-truth.md) says, and the warehouse is a copy. Give every reporting user a query time limit, as [Set time limits on every query](https://agentwranglers.se/playbook/data/operations/query-timeouts.md) does.

## Sources

- [PostgreSQL Hot Standby](https://www.postgresql.org/docs/current/hot-standby.html)

## Related rules

- DAT-46 [Read from replicas only what may lag](https://agentwranglers.se/playbook/data/caches-and-copies/replica-lag.md) in Data and databases
- DAT-44 [Name the source of truth](https://agentwranglers.se/playbook/data/caches-and-copies/source-of-truth.md) in Data and databases
- DAT-37 [Set time limits on every query](https://agentwranglers.se/playbook/data/operations/query-timeouts.md) in Data and databases

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/data-engineering/warehouse-and-models/separate-warehouse">Agent Wranglers data engineering playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Land raw data unchanged and build tables in layers](https://agentwranglers.se/playbook/data-engineering/warehouse-and-models/raw-then-models.md)
- [Warehouse and models](https://agentwranglers.se/playbook/data-engineering/warehouse-and-models.md)
