Speeds up grid query - moves count into subquery. Test and submit pull request to CKAN