Reputation: 35274
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?
Upvotes: 0
Views: 757
Reputation: 80340
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.
Upvotes: 1