There exists code in the AbstractCheckUserPager that combines the rows from the three result tables, groups these rows, sorts these rows, and then truncates to the limit. This code will be duplicated in Special:Investigate related code, so moving this to service will help reduce duplication and make testing easier.
It should be possible to move the code in AbstractCheckUserPager::groupResultsByIndexField and some of AbstractCheckUserPager::reallyDoQuery into the service for use by Special:Investigate in T347102. However, this code needs to be updated to support grouping by multiple fields so this will involve more than just moving existing code to a service. Doing this will be useful to make T360712 easier to achieve.