【发布时间】:2016-12-01 01:04:15
【问题描述】:
我来自 RDMS 背景,最近开始使用 DynamoDB。
我有以下带有三个全局二级索引 (GSI) 的 DynamoDB 表
Id(主键)、user_id(GSI)、event_type(GSI)、product_id(GSI) ) , 率, 创建日期
我有以下三种查询模式:
- a) 在哪里 event_type=?
- b) 在哪里 event_type=? AND product_id=?
- c) 在哪里 product_id=?
- d) 在哪里 product_id=? AND user_id=?
我知道在 MySQL 中我需要创建以下索引来优化上述查询:
- 复合索引(event_type,product_id):用于查询“a”和“b”
- 复合索引(product_id,user_id):用于查询“c”和“d”
我的问题是,如果我在 DyanomoDB 中为“event_type”、“product_id”和“user_id”字段创建三个 GSI,查询模式“b”和“d”是否利用这三个独立的 GSI?
【问题讨论】:
-
DynamoDB 是基于 indexedDB 的吗? indexedDB 是浏览器支持的嵌入式数据库,可通过 Javascript 访问。如果您的问题与此无关,请删除标签。
标签: amazon-web-services indexing amazon-dynamodb