⬅︎ Back to Best way to count distinct indexed things in PostgreSQL
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.
Comment
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.