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

create-gsi-dynamodb-sayem

I want 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.

Note: There is an initial limit of 20 global secondary indexes per table. To request a limit increase, contact AWS Support.

  1. Open the DynamoDB console.
  2. In the navigation pane, choose Tables, and then select your table from the list.
  3. Choose the Indexes tab.
  4. Choose Create index.
  5. Enter a partition key and an optional sort key.
  6. Provision read and write capacity for your index.
    Note:
    Consider your use case and review DynamoDB’s pricing model before provisioning a large amount of read and write capacity.
  7. Choose Create index.

If you have a large table, it might take a long time to create the global secondary index. Use the OnlineIndexPercentageProgress Amazon CloudWatch metric to monitor the creation progress:

  1. Open the DynamoDB console.
  2. In the navigation pane, choose Tables, and then select your table from the list.
  3. Choose the Metrics tab.
  4. Choose View all CloudWatch metrics.
  5. In the search box, enter OnlineIndexPercentageProgress.
    Note: If the search returns no results, wait about a minute for metrics to populate. Then, try again.
  6. Choose the name of the index to see the progress.

You can speed up creation of your global secondary index by provisioning additional write capacity:

  1. Open the DynamoDB console.
  2. In 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.
  5. After about a minute, check the OnlineIndexPercentageProgress metric to see if the creation of your global secondary index is going faster.

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

Updated: 2019-02-11