Database Reference
In-Depth Information
the smallest local secondary index we can create (we are not going to discuss projections
yet. We will discuss them in Chapter 4 , Working with Secondary Indexes ). Take a look at
the following table:
You will quickly notice that the third item did not have the secondary index attribute, so
that item is not available in the index. One more change is that the index is sorted on the
PubDate attribute, so the first item became the second item.
In the case of the local secondary index, there is a restriction that the hash key of the table
must be the hash key of the index too. In order to overcome this, we can also specify the
user-defined (non-primary key attribute) attribute as the hash key attribute of the second-
ary index. Then this index will be called the global secondary index.
Let's take a scenario in which we need to count the number of unique languages a publish-
er has published the topic in. In this case, the publisher name will become the GROUP BY
Search WWH ::




Custom Search