Query persistence for load on demand and storing of keys