Fixed sorting by row count, calcuating can be done on db level