Fix fetching always using time on ice and invalid sql operator