> For the complete documentation index, see [llms.txt](https://mamawhocode.gitbook.io/aws/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mamawhocode.gitbook.io/aws/services/database/dynamodb/scan.md).

# Scan

## Parameters

* When you use the `--limit` parameter with the `scan` operation in DynamoDB and set it to 5, it indeed instructs DynamoDB to evaluate only the first 5 items in the table.
  * **Without `--filter`**: If you set `--limit 5` without a filter, DynamoDB evaluates the first 5 items and returns them as the result of the scan.
  * **With `--filter`**: If you set `--limit 5` and also specify a `--filter` expression, DynamoDB still evaluates the first 5 items. However, it only returns those that match the filter criteria. If fewer than 5 items match the filter, then fewer than 5 items are returned. If none of the first 5 items match the filter, it returns no items. In either case, it only evaluates 5 items before stopping.

{% hint style="info" %}
If you do not use a filter expression, `ScannedCount` and `Count` have the same value.
{% endhint %}

* The `page-size` parameter will determine the number of items returned in each page of a query.
* If there are more items available than the specified `--max-items` value, the response includes a `NextToken` value.

## Best practices

Avoid using [scan](/aws/services/database/dynamodb/scan.md) operation on large table or index, use Filter `--filter-expression` and Projection `--projection-expression` , and `--page-size` to get specific data instead.

<img src="https://2259236002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuh9xZDZ53qGqmMCM44PU%2Fuploads%2Fa6VA2KLRFlR70tZUC5Ej%2Fimage.png?alt=media&amp;token=a82f458c-bdd5-4852-ad42-117d3bb2730d" alt="" data-size="original">

## Trivia

* 1 single DynamoDB scan can retrieve max 1MB.
