Begin to do query.