title: mysql COUNT(*) vs COUNT(DISTINCT col)
body: <p>Q1: why count(*) is so much slower than count(distinct col)?</p>
  
  <p>Q2: should id always use count(distinct col)?</p>
  
  <pre><code>select count(id) from source;
  +-----------+
  | count(id) |
  +-----------+
  |     22713 |
  +-----------+
  1 row in set (0.73 sec)
  
  mysql&gt; select count(distinct id) from source;
  +--------------------+
  | count(distinct id) |
  +--------------------+
  |              22836 |
  +--------------------+
  1 row in set (0.08 sec)
  </code></pre>