adds query log history