Interview practice question
Slow MERGE on a huge table
Data Engineering · Snowflake · Intermediate
A MERGE into a 2 billion row table takes 40 minutes, even though only 1 million rows change daily. How do you speed it up?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- MERGE often scans the whole target to find matches.
- Add a filter on the target, like a date range, so pruning works.
- Cluster or load the target by the column used in that filter.
- Deduplicate and shrink the source before merging.
- Consider delete plus insert by partition if it fits the data.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.