【发布时间】:2019-05-18 10:05:12
【问题描述】:
我将时间序列数据存储在 bigtable 中,rowKey 为 userId#timestamp。给定 (userId, startTime, endTime) 的查询参数,我如何支持分页,即从 'offset' 开始返回 'limit' 记录?
注意 userId#startTime rowKey 可能在 bigtable 中不存在,但在 startTime/EndTime 之前和之后会有一些数据点。 Bigtable Go 客户端似乎支持带有 prefixRange 参数的 ReadRows。当我使用 ReadRows 进行迭代时,我可以使用 userId 的 prefixRange 和“seek”到 startTime,但是如果 starTime/endTime 是过去的方式,这似乎非常低效。有没有更好的办法??
【问题讨论】:
-
这篇文章可能有你要找的东西,看看,让我知道它适合你:stackoverflow.com/questions/49691823/…
-
谢谢 maxim,但是 bigtable Go 客户端没有 Node 客户端那样的 readStream 接口。
标签: go pagination google-cloud-platform google-cloud-bigtable