Reputation: 11
I am just wondering in which scenario DynamoDB Scan is advantageous over Query? If Scan is time consuming and inefficient why did AWS even have it? We can get entire table dump by using Query. Can someone explain the use Scan?
Upvotes: 0
Views: 169
Reputation: 5659
We can get entire table dump by using Query.
This is not correct.
Every item in DynamoDB needs a primary key, which can either be the partition-key or a combination of partition-key and sort-key. To Query
, the least you need to do is supply the partition-key. To Scan
, you don't need to supply anything. In other words, Scan
operation allows you to scan the entire table.
Upvotes: 2