HyperLogLog

Stop Using COUNT(DISTINCT). Your Database Is Begging You.

COUNT(DISTINCT) is the most expensive query in your stack, forcing your database to track every unique value just to deliver a number that’s approximately right anyway. The real problem isn’t the database — it’s the cultural assumption that exact answers are always required. Most business decisions don’t change based on whether that count is 4,991,203 or 5,000,000. Stop burning compute on false precision and start using smarter approximations.