Optimize feed queries