I wonder why total runtime of count(*) is smaller than count(primary_key) of the same table?
Query plan (using explain analyze) shows that every time Postgresql is doing Seq Scan instead of using indexes? Why is that happening? and why indexes aren't used in this case?
Edited: count(1)
doesn't make any difference.