Secondary indexes don't guarantee uniqueness. From the docs:

In a DynamoDB table, each key value must be unique. However, the key values in a global secondary index do not need to be unique.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html#GSI.scenario

Answer from Mike Hornblade on Stack Overflow
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › working with tables, items, queries, scans, and indexes › improving data access with secondary indexes in dynamodb
Improving data access with secondary indexes in DynamoDB - Amazon DynamoDB
April 15, 2026 - Every secondary index is associated with exactly one table, from which it obtains its data. This is called the base table for the index. When you create an index, you define an alternate key for the index (partition key and sort key). You also define the attributes that you want to be projected, ...
🌐
Medium
joudwawad.medium.com › dynamodb-indexes-deep-dive-afe86a1cac48
DynamoDB Indexes Deep Dive | By Joud W. Awad | Medium
1 week ago - A projection is the set of attributes that is copied from a table into a secondary index. The partition key and sort key of the table are always projected into the index; you can project other attributes to support your application’s query requirements. When you query an index, Amazon DynamoDB can access any attribute in the projection as if those attributes were in a table of their own.
Discussions

amazon web services - Uniqueness in DynamoDB secondary index - Stack Overflow
Question: DynamoDB tables with a primary key that is a composite hash-range key are unique. Does this extend to secondary indices too? Example: I have a comments DynamoDB table with a post_id pr... More on stackoverflow.com
🌐 stackoverflow.com
Secondary Index in DynamoDB
Hi, I have a use case where I am fetching data on certain items (unique itemID) multiple times a day (identified by day_BatchTime) and storing them on a dyanmoDB. My composite primary key consist... More on repost.aws
🌐 repost.aws
3
0
March 13, 2022
DynamoDB - performance difference between querying primary index and global secondary index?
Try this search for more information on this topic. Comments, questions or suggestions regarding this autoresponse? Please send them here . I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/aws
5
1
September 3, 2024
amazon web services - how can I query off a AWS dynamodb table with a secondary index - Stack Overflow
What kind of secondary index? Note that you can only query a single partition (in a table or an index) at a time. ... Save this answer. ... Show activity on this post. A simple solution to your issue, assuming you do not write more that 1000WCU per second, is to have a static value as your GSI PK. Let's use the value 1 as an example. const lastweek = '2023-03-10T12:00:59.000Z' dynamodb... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

What is the DynamoDB index cost?
DynamoDB Indexes are free of charge. However, when you're writing data to the table and index is affected by this, it will consume provisioned WCUs for this operation. This means that if you're writing an item to the table with 4 GSIs and that item has 4 attributes which are indexed by these GSIs, you're going to pay x4 for this. For more writing scenarios, head to AWS docs. Moreover, there are also storage considerations: 100 bytes of overhead per index item, size in bytes of the projected attributes (if any) and size of the index key attribute.
🌐
dynobase.dev
dynobase.dev › dynamodb-indexes
DynamoDB Indexes Explained [Local & Global Secondary Index]
What is the difference between primary index and secondary index in DynamoDB?
The key difference is that the primary index has to exist while the secondary indexes are optional. Primary index uniquely identifies each of the items in the table while secondary indexes only allow you to query them using different attributes.
🌐
dynobase.dev
dynobase.dev › dynamodb-indexes
DynamoDB Indexes Explained [Local & Global Secondary Index]
What is an Inverted index in DynamoDB?
Inverted Index is a GSI that is basically a primary key but inversed - table's _hash key_ becomes inverted index's sort key and table's sort key becomes inverted index's _hash key_.
🌐
dynobase.dev
dynobase.dev › dynamodb-indexes
DynamoDB Indexes Explained [Local & Global Secondary Index]
🌐
ScyllaDB
scylladb.com › home › dynamodb secondary index
What is a DynamoDB Secondary Index? Definition & FAQs | ScyllaDB
August 7, 2025 - Secondary indexes add alternative query paths. However, they store another copy of every projected attribute in separate index partitions, so each write costs extra I/O and storage.
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › working with tables, items, queries, scans, and indexes › improving data access with secondary indexes in dynamodb › using global secondary indexes in dynamodb
Using Global Secondary Indexes in DynamoDB - Amazon DynamoDB
You could have a table with a simple primary key (partition key), and create a global secondary index with a composite primary key (partition key and sort key)—or vice versa. The index key attributes can consist of any top-level String, Number, or Binary attributes from the base table. Other scalar types, document types, and set types are not allowed. You can project other base table attributes into the index if you want. When you query the index, DynamoDB can retrieve these projected attributes efficiently.
🌐
DynamoDB
dynobase.dev › dynamodb-indexes
DynamoDB Indexes Explained [Local & Global Secondary Index]
They allow you to quickly query and lookup items based on not only the primary index attributes, but also attributes of your choice. Secondary Indexes, unlike primary keys, are not required, and they don't have to be unique.
Find elsewhere
🌐
Caylent
caylent.com › blog › best-practices-for-secondary-indexes-with-dynamodb
Best Practices for Secondary Indexes with Amazon ...
February 19, 2020 - For example, if you have a web application that needs to store and retrieve key-value pairs, you can get much better performance out of a purpose-built data store like DynamoDB than you can a traditional relational data store like SQL Server.
🌐
Awsstudygroup
000060.awsstudygroup.com › 1-introduce › 1.3-secondaryindexes
Secondary Index :: WORK WITH AMAZON DYNAMODB
Secondary Index allows to query data in the table with different keys from the original partition key and sort of the table.
🌐
DBI Services
dbi-services.com › accueil › amazon dynamodb: the cost of indexes
Amazon DynamoDB: the cost of indexes
August 13, 2020 - Because DynamoDB tables are physically organized by the primary key (hash partitioning with local index when a sort key is defined) this KeySchema can be considered the primary index. Then any additional index is a secondary index.
🌐
Momento
gomomento.com › home › which flavor of dynamodb secondary index should you pick?
Which flavor of DynamoDB secondary index should you pick? - Momento
June 7, 2024 - Data from your table (the primary index) is projected into your secondary indexes by the DynamoDB service based on the index definition you provide. You can’t write directly to a secondary index, but when you write to an item in your base table DynamoDB will project relevant changes into your secondary indexes for you.
🌐
AWS re:Post
repost.aws › questions › QUiejkilJ3QG2yNaPKVmCzeA › secondary-index-in-dynamodb
Secondary Index in DynamoDB | AWS re:Post
March 13, 2022 - Global secondary index details Name feedDate-index Status Active Partition key feedDate (String) Sort key - Read capacity Range: 1 - 10; Auto scaling at 70%; Current provisioned units: 1 Write capacity Range: 1 - 10; Auto scaling at 70%; Current provisioned units: 1 Size 2.4 megabytes Item count 8527 ... DynamoDB is designed for quick LOOKUP using specific keys.
🌐
AWS
aws.amazon.com › blogs › database › multi-key-support-for-global-secondary-index-in-amazon-dynamodb
Multi-key support for Global Secondary Index in Amazon DynamoDB | Amazon Web Services
November 20, 2025 - Global Secondary Indexes support multi-attribute keys, allowing you to compose partition keys and sort keys from multiple attributes. Each attribute maintains its own data type (string, number or binary) providing flexible querying capabilities.
🌐
AWS re:Post
repost.aws › knowledge-center › dynamodb-gsi-lsi-difference
Know the difference in global and local secondary indexes | AWS re:Post
August 9, 2024 - To create a local secondary index for an existing table, create a new table with a local secondary index. Then, use the AWS CLI or AWS SDK to migrate the data to the destination table. For more information, see How can I migrate my DynamoDB tables from one AWS Account to another?
🌐
Datatinkerer
datatinkerer.io › p › how-airtable-saved-millions-by-cutting
How Airtable Saved Millions by Cutting Archive Storage Costs by 100x
April 23, 2026 - They moved petabytes of archive data out of MySQL, kept recent data in the transactional store, archived old rows into base-partitioned Parquet files on S3 and queried those files with an embedded DataFusion engine. Along the way, they layered in DynamoDB metadata registration, a large-scale migration pipeline, bulk and shadow validation, multiple caching layers, custom secondary indexes and bloom filter-based pruning.
🌐
Jun711 blog
jun711.github.io › home › aws
AWS DynamoDB Global And Local Secondary Indexes Comparison | Jun711 blog
February 19, 2019 - Thus, there is a need for another table or data structure that stores data with different primary key and maps a subset of attributes from this base table. This other table is called a secondary index and is managed by AWS DynamoDB.
🌐
Reddit
reddit.com › r/aws › dynamodb - performance difference between querying primary index and global secondary index?
r/aws on Reddit: DynamoDB - performance difference between querying primary index and global secondary index?
September 3, 2024 -

When I look at documentation for querying against a DynamoDB's index, it suggests that you can get single-digit-millisecond latency when querying for a DynamoDB item by its primary key.

What's the latency difference when querying for a DynamoDB item by the partition (or partition+sort) key specified by the table's global secondary index? I assume that the latency would be slightly higher because internally DynamoDB would have to first traverse the GSI's tree to find the primary key of the correct item, and then query for that item by its primary key....but idk whether slightly = 1ms, 10ms, 100ms, etc.

🌐
Medium
medium.com › @mahimamanik.22 › primary-key-and-secondary-indexes-in-dynamodb-6c658bd3ae15
Primary Key and Secondary Indexes in DynamoDB | by Mahima Manik | Medium
October 4, 2022 - Therefore, in DynamoDB we create additional indexes based on our common access patterns for faster query operations. ... Indexes other than the Primary key can also be used to query data from the table. These indexes are declared as secondary ...
🌐
TutorialsPoint
tutorialspoint.com › dynamodb › dynamodb_indexes.htm
DynamoDB - Indexes
They accelerate application accesses and data retrieval, and support better performance by reducing application lag. A secondary index holds an attribute subset and an alternate key.