SpinTheMic
Pro

Explain it in 60 seconds

Approximate aggregate functions

Data Engineering · SQL · Experienced

When and why would you use approximate functions like APPROX_COUNT_DISTINCT?

What a strong answer covers

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

  • Exact COUNT(DISTINCT) on huge data needs a lot of memory and shuffling.
  • Approximate functions use algorithms like HyperLogLog with small error, around 1 to 2 percent.
  • Much faster and cheaper on billions of rows.
  • HLL sketches can be stored and merged across days.
  • Not for financial or compliance numbers that must be exact.
Practise this topic

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

See all topics