I need to execute an in query on the key attribute. Since, query doesn't provide in condition, I am planning to use scan. Will scan on key attribute scan the entire table?
-
As of April 2014, you can use IN in queries aws.amazon.com/blogs/aws/…emilyk– emilyk2014-11-25 23:32:35 +00:00Commented Nov 25, 2014 at 23:32
2 Answers
Will SCAN on key attribute scan the entire table?
Yes, see Query and Scan in Amazon DynamoDB:
Scan
A scan operation scans the entire table. You can specify filters to apply to the results to refine the values returned to you, after the complete scan. Amazon DynamoDB puts a 1MB limit on the scan (the limit applies before the results are filtered). A scan can result in no table data meeting the filter criteria.
Specifically, there is no difference between key and non key attributes as far as the Scan API is concerned, i.e. you simply provide the desired attributes by name, regardless of them being used as an attribute constituting the Primary Key as well or not:
AttributesToGet
Array of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
2 Comments
3 Comments
BatchGetItemRequest nails down to a list of up to 100 Keys. the Key contains AttributeValue for both hash key and range key to precisely identify a record in a table. btw, a record is essentially a Map and it is your responsibility to convert your pojos in and out of those.