How Cloudflare cut query times by 35x without leaving Postgres:
Avi Chawla
Visit on X@_avichawla74K followers
22,094 views
How Cloudflare cut query times by 35x without leaving Postgres:
Their Postgres tables hit billions of rows, and every time-range query started getting slower.
Plain Postgres scans the entire table on every query, regardless of the time window.
They tried the manual route by building precomputed aggregates with cron jobs and evaluating ClickHouse, which needed a full ingestion pipeline just to handle their write pattern.
Here's where most teams get stuck at exactly this point.
They utilize manual partitioning, splitting data into child tables by day or month. Then they wire up cron jobs to refresh aggregate tables.
Every schema change after that requires updating the cron logic and coordinating across teams. The infrastructure becomes the project.
Tiger Cloud is managed TimescaleDB by Tiger Data - Creators of TimescaleDB on the Postgres you already know, with automatic time-based partitioning, continuous aggregates, and compression built in from the start.
Cloudflare moved to TimescaleDB after exhausting the manual route and saw 5-35x query performance improvement on the same data.
Here is how it works:
→ Hypertables partition data by timestamp automatically. Every time-range query hits only the relevant chunk, not the full table.
→ Continuous aggregates refresh incrementally in the background, with no cron jobs to maintain.
To show what this looks like in practice, I built a real-time earthquake intelligence dashboard on a 3D globe using Claude Code and Tiger Cloud in a single session.
The USGS earthquake catalog has 400,000+ events since 1900, each a timestamped row. The dashboard plots them as ripple animations sized by magnitude and colored by depth, with a time slider that scrubs through 120 years of seismic history.
Every slider position fires a live query against the hypertable, and the side panel pulls from continuous aggregates.
Claude Code connected to Tiger Cloud through the Tiger CLI MCP server, provisioned the database, pulled the USGS catalog, and assembled the full Next.js and Three.js frontend without leaving the session.
The video below shows the final build in action, and I worked with the Tiger Data team to put this together.
Tiger CLI is open-source (Apache 2.0) and works with Claude Code, Cursor, Codex, Gemini CLI, and VS Code.
To try this yourself:
→ Sign up for Tiger Cloud here:
New accounts get $1,000 in free credits, no credit card required.
→ Install Tiger CLI: curl -fsSL https(:)//cli(.)tigerdata(.)com | sh
→ Run tiger mcp install claude-code
→ Give Claude Code a prompt and let it build.
I also wrote a full walkthrough on how you can turn any coding agent into a production-grade data engineer that can manage over a billion-row Postgres workloads.
It covers everything from the database setup to the final build.
Read it below.
Comments
Comments from the original post on X (Twitter)
No comments yet
