A hash-table based alternative to COUNT(DISTINCT ...) aggregate in PostgreSQL.