在Snowflake上运行两个对同一隔离表快照的SELECT语句。

huangapple go评论58阅读模式
英文:

Run two select statements on the same isolated table snapshot in Snowflake

问题

我需要在一个表上运行两个查询语句。我希望第二个查询语句在第一个查询已经运行的相同数据快照上运行。我想忽略这两个查询语句之间可能发生的写操作。如何正确处理这个情况?

Snowflake是否支持快照隔离?这个社区答案似乎暗示支持,而官方文档似乎只支持读已提交隔离级别。将这两个查询语句放在一个事务中是否确保它们看到相同的数据?

英文:

I need to run two select statements on a table. I want the second select statement to run on the same data snapshot that the first one has run on. I want to ignore the writes that could have happened between these select statements. What's the right way to go about it?

Does Snowflake support Snapshot Isolation? This community answer seems to suggest it does, and the offical docs seem to suggest that it only supports Read committed isolation. Does keeping these two select statements in a transaction ensures they will see the same data?

答案1

得分: 1

你可能想要使用Snowflake的时间旅行功能。请查看此处的文档

英文:

You probably want to use Snowflake's Time Travel feature. Have a look at the documentation here

huangapple
  • 本文由 发表于 2023年7月10日 18:14:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76652753.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定