When you need to find every active case that belonged at some point in time to a given category, you can do this easily without the need for examining all the case events for every active case.
The solution is to execute your search using the following search syntax:
status:active "category changed from '<category>'
where you replace
'<category>' with the category's name that you are looking for.