Limit and sort groups on group index