8.4 Avoid “SELECT count(DISTINCT field) FROM tbl”
This query looks familier to SQL users, but this query is very slow because only one reducer is used to process the request.
SELECT count(DISTINCT field) FROM tbl
So please rewrite the query like below to leverage multiple reducers.
SELECT
count(1)
FROM (
SELECT DISTINCT field FROM tbl
) t