GAE/J Low-level API: FetchOptions usage

和自甴很熟 提交于 2020-01-02 10:15:29

问题


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:


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.



来源:https://stackoverflow.com/questions/1995302/gae-j-low-level-api-fetchoptions-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!