Sayem shows you how to
monitor the creation of a
global secondary index

create-gsi-dynamodb-sayem

I’d like to speed up queries against non-key attributes in my table. How do I create, monitor, and optimize the creation of a global secondary index for a table in Amazon DynamoDB?

A well-designed global secondary index (GSI) can help you retrieve data that is related to a targeted query from a large table in much less time than it would take to scan the entire table.

To create a global secondary index, follow these steps:

  1. Open the DynamoDB console.
  2. From the navigation pane, choose Tables.
  3. Select your table from the list.
  4. Open the Indexes tab.
  5. Choose Create index.
  6. Enter a useful partition key and an optional short key for sorted range index on the range primary key attribute.
  7. Provision read and write capacity for your index. Note: Provisioning large amounts of capacity can lead to a high bill; consider your use case and understand DynamoDB’s pricing model before provisioning a large amount of read and write capacity.
  8. Choose Create index.

Creation of your global secondary index will begin. You can monitor the progress on the Metrics tab:

  1. Choose the Metrics tab.
  2. Choose View all CloudWatch metrics.
  3. In the CloudWatch console, choose DynamoDB.
  4. In the Search Metrics box, enter OnlineIndexPercentageProgress. Note: If the search returns an empty list, wait about a minute for metrics to populate.
  5. Choose the name of the index to see the progress.

If your global secondary index is taking too long to create (common when adding indexes on an existing large table), you can provision additional write capacity by following these steps:

  1. Open the DynamoDB console.
  2. From the navigation pane, choose Tables, and then select your table from the list.
  3. Choose the Capacity tab.
  4. Increase the write capacity of the index, and then choose Save.

After about a minute, check the OnlineIndexPercentageProgress metric from the Metrics tab to see if the creation of your global secondary index is progressing satisfactorily.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-07-22