【问题标题】:Read Only Transaction - Performance of time stamp bound reads只读事务 - 时间戳绑定读取的性能
【发布时间】:2017-08-08 02:03:34
【问题描述】:

我指的是只读事务,带有选项 min_read_timestamp。根据文档,它以时间戳 >= min_read_timestamp 执行所有读取。

假设我有一个包含数百万行的表,但从特定时间戳开始,只写入了几行。这次读取的性能如何(假设自时间戳以来只写入了几行)? spanner 是否在内部根据写入时间戳维护任何索引以提高此类读取的性能,或者我仍然必须依靠自己的索引来加快读取速度。

【问题讨论】:

    标签: google-cloud-platform google-cloud-spanner


    【解决方案1】:

    根据documentation,带有 min_read_timestamp 的 ReadOnlyTransaction 将选择 timestamp >= min_read_timestamp 并将返回在此 timestamp 或之前更新的所有数据。 p>

    因此,在查询中使用它来更新特定行,因为 min_read_timestamp 的用法不正确。

    我建议使用查询来选择 timestamp_column >= specific_timestamp 的所有行并创建一个复合索引。

    Cloud Spanner 不会创建索引来优化此查询类型。您可能想要创建自己的索引,但我建议您阅读以下内容: https://cloud.google.com/spanner/docs/schema-design#creating_indexes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-09
      • 2010-11-19
      • 1970-01-01
      • 2020-04-25
      • 2010-10-14
      相关资源
      最近更新 更多