Optimized getRecentArticlesForCategories() query