fuel/orm — pull request #353 by sjamaan (2014-06-11 06:46:12+00:00)
Title: In "count" queries, do not add all the columns from relations.

Same as https://github.com/fuel/orm/pull/352, but cherry-picked into 1.8:

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.