Case studies
Longer reads on the hard problems — the situation, the approach, and the measurable outcomes.
Cutting a 2.7-minute PostgreSQL query down to 2 milliseconds
A critical PostgreSQL query was taking ~2.7 minutes under production load, dragging down responsiveness across a high‑traffic system. By analyzing the SQL query and introducing partial indexe, I brought it down to ~2 ms ( a ~99.9% improvement ) with no change to application behaviour.
From 7 minutes to 7 seconds: speeding up a 1,000-item bulk import
A new API let clients submit up to 1,000 items (diamonds, jewelry, or gemstones) in a single request, and it was taking about 7 minutes to respond long enough to freeze the page. I switched it to insert records in batches, moved the per-record callback work to a background job (Sidekiq), and tightened the database queries (selecting only the fields it needed and adding indexes). That brought the response time down from ~7 minutes to ~7 seconds.
Reduce Twilio SMS costs with GSM/UCS character validation
SMS messages sent to customers via an internal Admin Toolkit (a Chrome extension) could exceed segment limits, inflating the Twilio bill. I added backend validation enforcing the correct character limits for both GSM and UCS‑2 encodings, preventing oversized multi‑segment messages and reducing SMS spend.