Compare queries and scans in the context of DynamoDB.

  • DynamoDB scan will read the entire table, so it might be slow and expensive.
  • DynamoDB query will use partitions and indexes more efficiently to fetch the requested data. In order to execute a query, you must define at least a partition key, and optionally a sort key.