Cost of DynamoDB paginated query

0

If DynamoDb's paginated query feature is used, will the cost of getting the first page of results be equal to the cost of getting all page's results?

I only want to know know if any records match a query of how many records have a partition key value matching a specific value and a sort key value less than a specified value, so I was thinking of using a paginated query with a limit of one. If the query returns any results for the first page then I know there's a match. I want to avoid fetching every record, because often there will be hundreds of thousands of matches but I only need to know if there is at least one.

asked 10 months ago200 views
1 Answer
0

You only pay for what you read. If you have a limit of 1 then you only pay to read one item.

However, if you use a filter expression then you pay to read whatever items match your KeyConditionExpression and the FilterExpression is applied afterwards.

In summary, whatever matches the KeyConditionExpression will be read, but can be reduced by using Limit.

profile pictureAWS
EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions