Ignore order_by when counting records using count_all

PostgreSQL does not allow sorting by column that is not selected. Furthermore, it does not make any sense to sort counted records.