Skip to content

Query Size Limits and Pageable

Sebastian J edited this page Jan 17, 2018 · 1 revision

The AWS SDK tries to load all results of a query into memory as one single list.

To activate lazy loading, the following DynamoDBMapperConfig has to be used:

DynamoDBMapperConfig.Builder builder = new DynamoDBMapperConfig.Builder();
builder.setPaginationLoadingStrategy(PaginationLoadingStrategy.ITERATION_ONLY);

This causes the result to be available as a lazy-loaded list - as long as no methods are called that affect the whole list. Those methods (like size()) will transparently retrieve the full result set!

Having the above ITERATION_ONLY PaginationLoadingStrategy in place allows to use the Pageable parameter on find methods.