Use GROUPBY instead of DISTINCT and subqueries when counting
Use automatically a subquery when counting with groups
Add existing GROUPBYs to count queries
Fix the tooltip's max page count in the joystick navigation