You could maybe benefit from the Group transaction support inside a partition. Store an entity responsible for holding the total numbers.
Then on each new insert of "the other entity" you should also increment the count on your totalentity.
It will reduce the query you would have to do on the table a lot.
/Rasmus
Best regards Rasmus Christensen