I'm using MySQL and I've read several times that COUNT(*)
is generally faster than COUNT(Column)
.
However, I need to get the COUNT
of distinct rows. From what I understand, I can do this in 2 different ways:
a) SELECT COUNT(DISTINCT Column) ...
or
b) SELECT COUNT(*) ... GROUP BY Column
In general, which is faster? If it depends, then what does it depend on?