Suppose I have this code:
Query<Car> q = ofy().load().type(Car.class);
for (Car car : q) {
// Do something with car...
}
How does Query<T> works, suppose the datastore contains million records, will Query load all Car objects into the memory or it will fetch it one by one from the datastore?
The default chunk size is 30 – see here. Prefetch size is not set so it defaults to chunk size.
So, iterator will fetch 30 Entities at a time.