Since I am not running the 4.x series right now, I might be confusing things by bringing this up, but why get the count via dmd?
If the database is close to the 3.X installations, how about this in MySQL?
select dedupid, count from events.status group by dedupid;
so select count from events.status where dedupid='some string'; should still be valid