quarks
quarks

Reputation: 35274

How does Objectify query works

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

Answers (1)

Peter Knego
Peter Knego

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

Related Questions