The DISTINCT in your COUNT
- Here is a query that shows up in every analytics workload: SELECT count(DISTINCT user_id) FROM events; It looks like the cheapest possible thing: count the distinct users.
- On a machine with cores to spare you would expect Postgres to throw a few parallel workers at it, the way it does for almost any large scan.
Unverified
- Here is a query that shows up in every analytics workload: SELECT count(DISTINCT user_id) FROM events; It looks like the cheapest possible thing: count the distinct users.
- On a machine with cores to spare you would expect Postgres to throw a few parallel workers at it, the way it does for almost any large scan.
Sources: Boringsql