2

What should I know about FetchOptions withLimit, prefetchSize and chunkSize? The docs say the following:

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)

...

prefetchSize and chunkSize have no impact on the result of the PreparedQuery, but rather only the performance of the PreparedQuery.

I'm not too sure how to use that in anger. What are the performance implications of different options? Any examples of how changes you've made have improved performance?

1 Answer 1

2

Setting bigger chunkSize/prefetchSize will improve performance of iteration over big result sets, but it also will increase latency. So bigger values should work better when you know that you are going to iterate over big result set.

2
  • Thanks. Any opinions about the relative sizes you should use? E.g. keep chunk & prefetch the same size? When should they be different? Jan 3, 2010 at 20:39
  • To best of my understanding in most of practical situations this parameters should be equal. Only thing that I may imagine is when you have really good estimation for required result set size which is quite big(this is a reason to setup bigger prefetch size) and a low probability that significantly more results will be neeeded(reason to set small chunk size).
    – user242726
    Jan 4, 2010 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.