Added dumping of query stats