Optimized post count retrieval.