Comment

Simon Waddington

I think you'll find that

  select count(*) from (select text_hash from main_songtexthash group by text_hash) t;

is even faster. Although it might depend on your dataset.