Need “about 497K unique users” faster than an exact COUNT(DISTINCT)?
Postgres gives you a few options: TABLESAMPLE, HyperLogLog and mergeable sketches.
The trick is knowing when each approximation works and where it breaks. Dive into this walkthrough: