Blog

Insights, updates, and best practices

sqloptimizationpostgressql-serverazure-sqlskewcardinality-estimationindexing

Why is my Whale Query 1000x Slower in Prod?

Ten enterprise customers own 80% of the orders. On uniform test data the query runs in ~1ms; on that real skew it runs ~1,000x slower. The fix doesn't transfer between engines: Postgres is rescued by one free session setting, SQL Server can't be touched by it and needs a completely different access-path fix. Measured on Neon and Azure SQL Database using ExoBench.