The same query on the same table ran in 30 seconds last week but takes 3 minutes today, with no changes to the query. Where do you look?
💡 Model Answer
I start by comparing the current execution plan with the one from last week to spot any plan changes. I check if statistics are stale or if the data volume has increased, which can alter cardinality estimates. I look at index fragmentation and whether any indexes have become less efficient. I also examine cache state—if the data is no longer warm, the query may hit disk. I review system load: CPU, memory, disk I/O, and network traffic that could be affecting query performance. I check for any new constraints, triggers, or changes in the schema that might impact the optimizer. If the query uses a materialized view or a cached result, I verify that it hasn't expired. By systematically inspecting these areas, I can pinpoint why the same query now takes longer.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500