gh-2374 make sort usable with count op