Você pode usar isso:
SELECT COUNT(*) FROM (SELECT DISTINCT column_name FROM table_name) AS temp;
Isso é muito mais rápido do que:
COUNT(DISTINCT column_name)
SELECT COUNT(*) FROM (SELECT DISTINCT column_name FROM table_name) AS temp;
COUNT(DISTINCT column_name)