Make datastore queries more efficient