0

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?

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

1

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.

Community
  • 1
  • 1
Peter Knego
  • 79,991
  • 11
  • 123
  • 154