speed query with 2 columns group by