- Published on
The query works fine in development with 1,000 rows. In production with 50 million rows it locks up the database for 3 minutes. One missing WHERE clause, one implicit type cast, one function wrapping an indexed column — and PostgreSQL ignores your index entirely.