# A 2-billion-row Postgres orders fact serves a quarterly report that aggregates two or three columns

Canonical URL: <https://datadriven.io/problems/a-2-billion-row-postgres-orders-fact-serves-a-quarterly-repo-934dcb65>

Domain: Pipeline Design · Difficulty: medium

## Problem

A 2-billion-row Postgres orders fact serves a quarterly report that aggregates two or three columns per query, but the dashboard takes 18 minutes because Postgres reads every column of every row. Apply the section's columnar-vs-row framing and replace the row-stored fact with a columnar destination so the I/O reduction, compression, and vectorized execution wins all apply.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/a-2-billion-row-postgres-orders-fact-serves-a-quarterly-repo-934dcb65)
- [System Design Interview Questions](https://datadriven.io/data-engineering-system-design)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.