the realization of  history query