Count(distinct) Is Too Slow: Approximations and Sampling in Postgres
snowflake.com