🌐
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 - DynamoDB supports two types of secondary indexes: Global secondary index — An index with a partition key and a sort key that can be different from those on the base table. A global secondary index is considered "global" because queries on the index can span all of the data in the base table, ...
🌐
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
When an application writes an item to a table, DynamoDB automatically copies the correct subset of attributes to any global secondary indexes in which those attributes should appear. Your AWS account is charged for storage of the item in the base table and also for storage of attributes in any global secondary indexes on that table.
Discussions

Suggestion for DynamoDB table index usage
What are the access patterns you're trying achieve out of this table? That should be first thing you should spend time on. And without access patterns laid out, it's a good guess that nobody can answer the question. More on reddit.com
🌐 r/aws
17
0
January 6, 2023
ELI5: Indexing in DynamoDB
LSIs are an alternative way to sort and query by the partition key on the main table. So, for example, your table's partition key is song name, and your sort key is release date. Those two fields would be the only ones you could query on directly. But let's say you wanted to also sort and query the song name by total sales. You'd make an LSI with a sort key of total sales. Both queries happen on the same table, it's just an alternate criteria to sort by on the partition. GSIs essentially function like separate tables, with their own read/write capacity. When you write to a table with a GSI, the data in the properties that you select is then also projected into the index (it could be the entire object, or it could be a subset of properties from the object), the data is just partitioned and ordered by a different set of properties, allowing you to query by a totally different criteria. Which should you use? It totally depends on your data usage. GSIs cost money, because you're paying for additional capacity for each one you define. LSIs are effectively free, but are only useful if you're querying by the main partition key. More on reddit.com
🌐 r/aws
3
13
December 3, 2019
Dynamodb - TTL expired item will get deleted in 48 hours? I want an instant deletion :(
If you are only caching items for 5 minutes have you considered using Redis instead? It should give you the behavior you desire and be faster for this type of workload. More on reddit.com
🌐 r/aws
9
10
November 12, 2018
Q: Design pattern for Time-Series data in DynamoDB
I’m a big advocate for using Elasticsearch for time series data. Excellent performance and indexing time, query anything, json compatible, and pretty popular overall. If dynamo isn’t cutting it or being difficult, perhaps it’s not the right tool for the job. More on reddit.com
🌐 r/aws
44
24
January 9, 2020
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › best practices for designing and architecting with dynamodb › best practices for using secondary indexes in dynamodb › general guidelines for secondary indexes in dynamodb
General guidelines for secondary indexes in DynamoDB - Amazon DynamoDB
April 16, 2026 - The following are some general principles and design patterns to keep in mind when creating indexes in DynamoDB: Use indexes efficiently · Choose projections carefully · Optimize frequent queries to avoid fetches · Be aware of item-collection size limits when creating local secondary indexes ·
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › best practices for designing and architecting with dynamodb › best practices for using secondary indexes in dynamodb › take advantage of sparse indexes
Take advantage of sparse indexes - Amazon DynamoDB
April 16, 2026 - For any item in a table, DynamoDB writes a corresponding index entry only if the index key attributes are present in the item. For a global secondary index, this means the index partition key must be defined on the item, and if the index also has a sort key, that attribute must be present too.
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › amazon dynamodb: how it works › from sql to nosql › managing indexes › creating an index
Creating an index - Amazon DynamoDB
August 19, 2022 - CREATE INDEX GenreAndPriceIndex ON Music (genre, price); In DynamoDB, you can create and use a secondary index for similar purposes.
🌐
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 › local secondary indexes
Local secondary indexes - Amazon DynamoDB
When an application writes an item to a table, DynamoDB automatically copies the correct subset of attributes to any local secondary indexes in which those attributes should appear. Your AWS account is charged for storage of the item in the base table and also for storage of attributes in any local secondary indexes on that table.
🌐
Medium
joudwawad.medium.com › dynamodb-indexes-deep-dive-afe86a1cac48
DynamoDB Indexes Deep Dive | By Joud W. Awad | Medium
5 days ago - When an application writes an item to a table, DynamoDB automatically copies the correct subset of attributes to any global secondary indexes in which those attributes should appear. Your AWS account is charged for storage of the item in the base table and also for storage of attributes in any global secondary indexes on that table.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › dynamodb › aws-dynamodb-working-with-indexes
AWS DynamoDB - Working with Indexes - GeeksforGeeks
March 28, 2023 - Whenever data is modified in the table, the index is automatically modified to reflect changes in the table. We can create and use a secondary index to query faster. While creating a secondary index, we must specify its key attributes—a partition key and a sort key. After the secondary index is created, we can perform operations such as Query or Scan just as we do on the table. DynamoDB doesn't have any query optimizer, so a secondary index is used while you Query it or Scan it.
🌐
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 | AWS Database Blog
November 20, 2025 - Design sparse indexes whenever possible to reduce costs by only indexing items that have values for your specified key attributes. Choose your projection type strategically: use ALL for flexibility, KEYS_ONLY to reduce storage costs, or INCLUDE to project only the attributes you need. Implement time to live (TTL) strategies in your base table to manage record size over time and prevent unbounded growth. In this post you learned how to work with composite keys GSIs. With this new DynamoDB feature you can query different data types and attributes without needing to use workarounds like concatenating attributes.
🌐
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 › local secondary indexes › working with local secondary indexes in dynamodb aws cli
Working with Local Secondary Indexes in DynamoDB AWS CLI - Amazon DynamoDB
aws dynamodb create-table \ --table-name Music \ --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S \ AttributeName=AlbumTitle,AttributeType=S \ --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE \ --provisioned-throughput \ ReadCapacityUnits=10,WriteCapacityUnits=5 \ --local-secondary-indexes \ "[{\"IndexName\": \"AlbumTitleIndex\", \"KeySchema\":[{\"AttributeName\":\"Artist\",\"KeyType\":\"HASH\"}, {\"AttributeName\":\"AlbumTitle\",\"KeyType\":\"RANGE\"}], \"Projection\":{\"ProjectionType\":\"INCLUDE\", \"NonKeyAttributes\":[\"Genre\", \"Year\"]}}]"
🌐
DynamoDB
dynobase.dev › dynamodb-indexes
DynamoDB Indexes Explained [Local & Global Secondary Index]
Still using AWS console to work with DynamoDB? 🙈 Time to 10x your DynamoDB productivity with Dynobase [learn more] What makes DynamoDB so much more than just a simple Key-Value store is the secondary indexes. They allow you to quickly query and lookup items based on not only the primary index attributes, but also attributes of your choice.
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › best practices for designing and architecting with dynamodb › best practices for using secondary indexes in dynamodb
Best practices for using secondary indexes in DynamoDB - Amazon DynamoDB
General guidelines for secondary indexes in DynamoDB · Use indexes efficiently · Choose projections carefully · Optimize frequent queries to avoid fetches · Be aware of item-collection size limits when creating local secondary indexes · Take advantage of sparse indexes ·
🌐
AWS
sdk.amazonaws.com › java › api › latest › software › amazon › awssdk › enhanced › dynamodb › DynamoDbIndex.html
DynamoDbIndex (AWS SDK for Java - 2.42.10)
Scans the table against a secondary index and retrieves all items using default settings. The result is accessed through iterable pages (see Page) in an interactive way; each time a result page is retrieved, a scan call is made to DynamoDb to get those entries.
🌐
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 › local secondary indexes › working with local secondary indexes: java
Working with Local Secondary Indexes: Java - Amazon DynamoDB
April 16, 2026 - The following Java code example creates a table to hold information about songs in a music collection. The partition key is Artist and the sort key is SongTitle. A secondary index, AlbumTitleIndex, facilitates queries by album title. The following are the steps to create a table with a local secondary index, using the DynamoDB document API.
🌐
Reddit
reddit.com › r/aws › suggestion for dynamodb table index usage
r/aws on Reddit: Suggestion for DynamoDB table index usage
January 6, 2023 -

Hi, I have loaded a table with the following structure: ID, Name, last name, location, score and some other attributes not relevant to the case.

The problem is to create the most efficient table in terms of cost and reading speed (not many writes will be done to this table). Also, it is expected that the table will be queried several times against the attributes I mentioned earlier. Most likely with one of those or a combination of many of them (e.g., name + last name + location).

In the beginning, I thought it would be good if the ID is the partition key and then create global secondary indexes for each one of the other attributes. However, now that I have loaded the data (10gb) I think I'm going to murder the project's budget with that approach.

Can you suggest me a better way to achieve this please?

🌐
OneUptime
oneuptime.com › home › blog › how to use dynamodb global secondary indexes
How to Use DynamoDB Global Secondary Indexes
January 26, 2026 - This differs from Local Secondary Indexes (LSIs), which share the same partition key as your base table and must be created at table creation time. ... Let's work through a practical example. You have an orders table where the primary key is userId (partition key) and orderId (sort key). Now you need to find all orders with a specific status. # Create a GSI on an existing table aws dynamodb update-table \ --table-name Orders \ --attribute-definitions \ AttributeName=status,AttributeType=S \ AttributeName=createdAt,AttributeType=S \ --global-secondary-index-updates \ "[{ \"Create\": { \"IndexNa
🌐
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 › working with global secondary indexes: java
Working with Global Secondary Indexes: Java - Amazon DynamoDB
The following Java code example creates a table to hold information about weather data. The partition key is Location and the sort key is Date. A global secondary index named PrecipIndex allows fast access to precipitation data for various locations. The following are the steps to create a table with a global secondary index, using the DynamoDB document API.
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › amazon dynamodb: how it works › core components of amazon dynamodb
Core components of Amazon DynamoDB - Amazon DynamoDB
A secondary index lets you query the data in the table using an alternate key, in addition to queries against the primary key. DynamoDB doesn't require that you use indexes, but they give your applications more flexibility when querying your data.