In "count" queries, do not add all the columns from relations.

This can make the difference between using no indexes and writing to disk for a
temp table and bringing down the system versus using indexes and completing in
a few milliseconds.

The comment "// Remove the current select and" seems to imply that this was the
original idea, but maybe the API somehow got changed which caused a performance
regression without anyone noticing it.