Database Reference
In-Depth Information
Going back to our example, let us assume that we are using the KEYS_ONLY index type,
so none of the attributes (other than the previous three key attributes) are projected into
the index. So the index will look as follows:
Tip
You may notice that the row order of the index is almost the same as that of the table order
(except the second and third rows. Here, you can observe one point: the table records will
be grouped primarily based on the hash key, and then the records that have the same hash
key will be ordered based on the range key of the index. In the case of the index, even
though the table's range key is part of the index attribute, it will not play any role in the
ordering. (only the index's hash and range keys will take part in the ordering).
There is a negative to this approach. If the user is writing a query using this index to fetch
BookTitle and Publisher with PubDate as 28-Dec-2008 , then what happens?
Will DynamoDB complain that the Publisher attribute is not projected into the index?
The answer is no. The reason is that even though Publisher is not projected into the
index, we can still retrieve it using the secondary index. We will discuss the scan and
Search WWH ::




Custom Search