SQL optimization in home, topics and birthday cron