SpinTheMic
Pro

Interview practice question

Slow MERGE on a large partitioned table

Data Engineering · BigQuery · Intermediate

A daily MERGE into a 15 TB partitioned table takes a long time and scans the whole target. How do you optimize it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Add a partition filter on the target in the ON clause.
  • Limit source to changed rows only.
  • Cluster target on the merge key.
  • Deduplicate the source before merging.
  • Consider insert-overwrite of affected partitions instead.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics