msc: #Refs 2108 Fix SQL count on Audit Page

Improve speed and save 4GB of SQL tmp file on some install with a lot of
history