Query engine: changes for temporal query