Improve delete by query