

# 在 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)