

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 DynamoDB 中次要索引的最佳實務
<a name="bp-indexes"></a>

次要索引對於支援您應用程式所需的查詢模式而言通常很重要。同時，過度使用次要索引或未有效地使用次要索引可能會增加非必要的成本並降低效能。

**Contents**
+ [DynamoDB 中次要索引的一般準則](bp-indexes-general.md)
  + [有效率地使用索引](bp-indexes-general.md#bp-indexes-general-efficiency)
  + [謹慎選擇投影](bp-indexes-general.md#bp-indexes-general-projections)
  + [最佳化頻繁查詢，避免擷取](bp-indexes-general.md#bp-indexes-general-fetches)
  + [在建立本機次要索引時請留意項目集合大小限制](bp-indexes-general.md#bp-indexes-general-expanding-collections)
+ [利用疏鬆索引](bp-indexes-general-sparse-indexes.md)
  + [DynamoDB 中疏鬆索引的範例](bp-indexes-general-sparse-indexes.md#bp-indexes-sparse-examples)
+ [使用全域次要索引以支援 DynamoDB 中的具體化聚合查詢](bp-gsi-aggregation.md)
  + [範例案例和存取模式](bp-gsi-aggregation.md#bp-gsi-aggregation-scenario)
  + [為什麼要預先運算彙總](bp-gsi-aggregation.md#bp-gsi-aggregation-why)
  + [資料表設計](bp-gsi-aggregation.md#bp-gsi-aggregation-table-design)
  + [使用 Streams 和 彙總管道 AWS Lambda](bp-gsi-aggregation.md#bp-gsi-aggregation-pipeline)
  + [稀疏 GSI 設計](bp-gsi-aggregation.md#bp-gsi-aggregation-sparse-gsi)
  + [查詢 GSI](bp-gsi-aggregation.md#bp-gsi-aggregation-querying)
  + [考量事項](bp-gsi-aggregation.md#bp-gsi-aggregation-considerations)
+ [在 DynamoDB 中多載全域次要索引](bp-gsi-overloading.md)
+ [在 DynamoDB 中使用全域次要索引寫入碎片，以進行選擇性資料表查詢。](bp-indexes-gsi-sharding.md)
  + [模式設計](bp-indexes-gsi-sharding.md#bp-indexes-gsi-sharding-pattern-design)
  + [碎片策略](bp-indexes-gsi-sharding.md#bp-indexes-gsi-sharding-strategy)
  + [查詢已分碎片的 GSI](bp-indexes-gsi-sharding.md#bp-indexes-gsi-querying-the-sharded-GSI)
  + [平行查詢執行注意事項](bp-indexes-gsi-sharding.md#bp-indexes-gsi-parallel-query-execution-considerations)
  + [程式碼範例](bp-indexes-gsi-sharding.md#bp-indexes-gsi-code-example)
+ [使用全域次要索引在 DynamoDB 中建立最終一致複本](bp-indexes-gsi-replica.md)