the.bay.news

The DISTINCT in Your COUNT

boringSQL | Supercharge your SQL & PostgreSQL powers
The DISTINCT in Your COUNT
COUNT(DISTINCT) has no combine function, so PostgreSQL can't merge per-worker results: the whole statement drops to one core and a disk-spilling sort. Push the distinctness into a GROUP BY instead and parallel query comes back.

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.