Database Reference
In-Depth Information
Projection
Once we have an understanding of the secondary index, we are all set to learn about projec-
tion. While creating the secondary index, it is mandatory to specify the hash and range at-
tributes, based on which the index is created. Apart from these two attributes, if the query
wants one or more attribute (assuming that none of these attributes are projected into the
index), then DynamoDB will scan the entire table. This will consume a lot of throughput
capacity and will have comparatively higher latency.
The following is the table (with some data) that is used to store topic information:
Here are few more details about the table:
• The
BookTitle
attribute is the hash key of the table and local secondary index
• The
Edition
attribute is the range key of the table
• The
PubDate
attribute is the range key of the index (let's call this index
IDX_PubDate
)