Or just use SQL just as you would on any other platform. This guarantees that only one query is performed. Something like:
SELECT COUNT(*) FROM {EntityName} WHERE yada yada .....
Hope this helps,
Curt
SELECT COUNT(*) FROM {EntityName} WHERE yada yada .....
Hope this helps,
Curt