Reputation: 1172
In official Amazon docs there's this text:
For example, suppose you have an Employee table with attributes such as Name, Title, Address, PhoneNumber, Salary, and PayLevel. Now suppose that you had a global secondary index named PayLevelIndex, with PayLevel as the partition key. Many companies only have a very small number of pay codes, often fewer than ten, even for companies with hundreds of thousands of employees. Such an index would not provide much benefit, if any, for an application.
I really don't understand how such index wouldn't be beneficial. What if we need to list all employees with a specific payLevel
? Even if we have only 2 distinct payLevels
, the index should help, right?
Upvotes: 0
Views: 58
Reputation: 1668
Its not really going to help. High cardinality is generally your goal when it comes to indexes in any database.
Consider also that this is their recommendation. Trust the documentation until you see something that conflicting in actual practice.
Upvotes: 1