Technical Mid Level

How do you diagnose and optimise a slow SQL query? Walk me through your approach using a real example.

Quick Tip

Always start with the execution plan. Look for full table scans and missing indexes first - they are the most common culprits and the easiest to fix.

What good answers include

Strong answers describe a systematic approach: using EXPLAIN or query plans, identifying full table scans, checking index usage, evaluating join strategies, considering query rewriting, and testing improvements. Best candidates discuss the trade-offs between query performance and readability, and when to denormalise for performance.

What interviewers are looking for

Practical SQL skill. Analysts who can only write queries but not optimise them become bottlenecks as data grows. Ask for a specific before/after example to gauge real experience.

← All Data Analyst questions