7

All the info regarding these two sums up to:

chunkSize

Sets the chunk size. Please read the class javadoc for an explanation of how chunk size is used.

prefetchSize

Sets the number of entities to prefetch.

Tried looking at the java docs, and at the source code in the SVN. No info at all! I mean, info regarding the actual implication of these two.

Well, prefetchSize is more or less clear - how many entities are fetched when running th query.
If my understanding is right, for example if I set the query's limit to 1000 and prefetchSize to 1000, it will read them all at once to the memory.

What about chunkSize? Is this in bytes size? Entities amount?

What are the effects of low/high number, set to these two?

Poni
  • 11,061
  • 25
  • 80
  • 121
  • 1
    App Engine is a large product with many features and APIs. It would help if you told us what specific feature you're talking about here, and where those snippets of text come from. – Nick Johnson Aug 03 '11 at 00:55
  • Edited. Added links. As you see, everything points to the class javadoc - maybe I'm missing it? Where is it if not the at the IDE/snippets/website/source-code? By the way Nick - you rock! – Poni Aug 03 '11 at 12:12

1 Answers1

6

The top of the page you linked to says:

prefetchSize is the number of results retrieved on the first call to the datastore.

chunkSize determines the internal chunking strategy of the Iterator returned by PreparedQuery.asIterator(FetchOptions) and the Iterable returned by PreparedQuery.asIterable(FetchOptions).

chunkSize's description is a bit vague, admittedly. It specifies the number of results to fetch on subsequent datastore requests (after the first prefetchSize results have been consumed).

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198