0
我有這些類型的文件在couchbase:Couchbase指標
{
delete: true,
entity: {
id: "1aec5ee9-bb4b-494d-9cfd-b7d890abad76",
name: 'Bob'
}
_class: "com.company.package.A"
}
{
delete: false,
entity: {
id: "5996c870-3b00-4c6a-a569-52b0c9e8adc9",
city: 'London'
}
_class: "com.company.package.B"
}
哪些索引將這些查詢會更好:
select * from bucket where _class = "com.company.package.A" and delete=true and entity.name = "Bob"
select * from bucket where _class = "com.company.package.B" and delete=false and entity.city = "London"
- GSI爲_class
- GSI已刪除
- GSI for entity.name,_class =「com.company.package.A」
- GSI爲entity.city,當_class = 「com.company.package.B」
OR
- GSI爲字段{entity.name,_class,刪除}的基團,當_class =「com.company.package.A」
- 組字段{entity.city,_class,deleted}時的GSI,_class =「com.company.package.B」時的GSI
- 不要創建單獨的GSI索引_class並全部刪除