less sql queries when restore logs