fix(engine): make historic statistics query precise

related to CAM-1659, CAM-1579