Clinical Communication Platform
TigerConnect Cuts Database Load on Its Heaviest Queries by 11.6x with Ravn and Claude Code
Ravn guided TigerConnect through a production-validated optimization of a care-provider lookup query that accounted for 68.5% of read time on its Postgres database, delivering the rewrite through a structured Claude Code workflow. Three weeks after deploy, the targeted read path was doing 11.6x less database work.
The Challenge
As part of an ongoing investment in platform reliability and performance visibility, TigerConnect engaged Ravn to analyze, optimize, and validate database query performance across the service. Ravn began by establishing where database time was actually being spent. Ravn analyzed a production pg_stat_statements export covering roughly 66 days of counters and 4.75 billion recorded calls. It showed that a single role-merge lookup joining care providers to patients accounted for 68.5% of tracked execution time across the top 40 queries. With writer CPU peaking around 18%, the platform had comfortable headroom. Ravn recommended scoping the work as a capacity and cost optimization, focused on making an already-stable system more efficient.
The Solution
Ravn then set the engagement's core standard, agreed with TigerConnect team members who held production database access: every optimization would be validated against the real production query planner, not synthetic data. Ravn designed a three-round EXPLAIN (ANALYZE, BUFFERS) process in which each request was a self-contained, PHI-masked document for TigerConnect's team to run against production. Each round refined the approach, strengthening PHI masking and sharpening the index-locality sampling, before anything shipped. Within that process, Ravn structured how Claude Code would contribute. Higher-reasoning models worked from the production plans to design the rewrite and the test strategy. Faster models executed against that specification to produce raw SQL. Ravn's engineers reviewed the output and owned all benchmarking. Ravn also directed the build of a differential test suite that checked the new query's output row-for-row against eleven real fixtures. The team deliberately broke the suite first, on both the old and new code paths, to confirm it could fail before relying on it to pass.
The Outcome
Care-provider query, single-plan execution time: 12.806 ms → 0.191 ms (67.0× faster), verified by one production EXPLAIN. Targeted read-path database load (5 audited query buckets): 69.16 ms → 5.95 ms of DB time per wall-clock second (11.6× less load), measured as a 20.6-day delta, pre- vs. post-deploy. Database time reclaimed: 31.3 hours over 20.6 days (about 1h 31m per day), same window. Alarm-lookup index efficiency: 1,858 / 901 rows scanned per lookup → 1.00 rows scanned per lookup, same window. Cross-check: new index scan counts, query call-count deltas, and buffer-hit-rate deltas agreed with each other to within 0.04%.
Tech & Cloud
Claude Code, deployed within a workflow Ravn designed around a clear division of labor. Claude Opus 4.8/5 at high reasoning effort (occasionally Fable 5) handled the design work: reasoning about the rewrite and test design from the production query plans. Claude Sonnet 4.6/5 at medium effort executed against that specification. Ravn kept production benchmarking (running query plans and reading output) as a manual, engineer-owned step, so every performance claim traces back to a human-reviewed production result.
MORE WORK
Other projects we've shipped.
Ready when you are
Your next build starts here
Tell us what you're working on. We'll tell you how we'd ship it, usually within a single business day.

Built by people, for people
The team you'll actually be working with.
US BUSINESS HOURS · NEARSHORE EXECUTION · NO OVERNIGHT HANDOFFS


