Optimized the clear feeds log db query