🌐
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 › 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 ·
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
I know that a Table in DynamoDB can be stored across multiple partitions. I know that an index is meant to speed up database query operations when… 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 › 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.
🌐
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.
🌐
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
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.
Find elsewhere
🌐
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 › amazon dynamodb: how it works › from sql to nosql › managing indexes › querying and scanning an index
Querying and scanning an index - Amazon DynamoDB
December 19, 2018 - /* All of the rock songs */ SELECT ... FROM Music WHERE Genre = 'Country' AND Price < 0.50; In DynamoDB, you perform Query and Scan operations directly on the index, in the same way that you would on a table....
🌐
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 › 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.
🌐
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 › 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 ·
🌐
ScyllaDB
scylladb.com › home › dynamodb secondary index
What is a DynamoDB Secondary Index? Definition & FAQs | ScyllaDB
August 7, 2025 - In DynamoDB, each table can have: Up to 5 LSIs — but these must be defined at the time of table creation and cannot be added later. Up to 20 GSIs — and these can be added or deleted at any time after the table is created. These limits are per table and are set by default. If you need more than 20 GSIs, you can request a service limit increase through AWS Support. Keep in mind that each index adds storage and write overhead, so it’s best to only create indexes that directly support your application’s query patterns.
🌐
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?

🌐
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.
🌐
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
🌐
Medium
medium.com › @joudwawad › dynamodb-indexes-deep-dive-afe86a1cac48
DynamoDB Indexes Deep Dive | By Joud W. Awad | Medium
March 6, 2025 - 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 ...