"It’s significantly more efficient to do a count of a subquery’s results than to try to do a count with DISTINCT in a single query." – @peterbe about the best way to count distinct indexed things in #Postgres:http://ed.gr/blxmj
Yes, it matters a lot. You're right to say that count(distinct x) is often slower than counting a subquery, but this is a poor example. The count(distinct x) has a hidden Sort operation inside the aggregate, which is sometimes faster and sometimes slower than the subquery