netohall
netohall
  • 发布:2025-02-18 11:18
  • 更新:2025-02-18 11:53
  • 阅读:68

【报Bug】省市区查询树形结构父节点路径

分类:uniCloud

产品分类: uniCloud/支付宝小程序云

示例代码:

//400毫秒查询
await dbj.collection('opendb-city-china')
.get({
getTreePath: {
startWith: code=='${result.code}'
}
})

//30毫秒查询
await dbj.collection('opendb-city-china')
.get({
getTreePath: {
limitLevel: 5,
startWith: code=='${result.code}'
}
})

操作步骤:

//400毫秒查询
await dbj.collection('opendb-city-china')
.get({
getTreePath: {
startWith: code=='${result.code}'
}
})

//30毫秒查询
await dbj.collection('opendb-city-china')
.get({
getTreePath: {
limitLevel: 5,
startWith: code=='${result.code}'
}
})

预期结果:

几十毫秒可以查询出来。

实际结果:

400毫秒查询

bug描述:

await dbj.collection('opendb-city-china')
.get({
getTreePath: {
limitLevel: 5,
startWith: code=='${result.code}'
}
})

该查询,如果没有limitLevel参数或者limitLevel为10,查询需要400毫秒。如果limitLevel设置5,则十几毫秒

2025-02-18 11:18 负责人:无 分享
已邀请:
DCloud_uniCloud_CRL

DCloud_uniCloud_CRL

设置索引试试

  • netohall (作者)

    code导入的时候自带索引的。limitLevel这个应该跟索引没关系吧

    2025-02-18 13:21

要回复问题请先登录注册