在大型删除或批处理语句中创建了多少个WAL日志?

发布于 2025-02-12 11:19:40 字数 92 浏览 2 评论 0原文

假设我从表中删除wery.a = 5,并且占1000万个记录。这会在WAL中创建1000万条目还是只有一个条目?

Let's say I do a DELETE FROM table WHERE table.a = 5 and that accounts for 10 million records. Will that create 10M entries in the WAL or will that just be a single entry?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花开雨落又逢春i 2025-02-19 11:19:41

WAL是磁盘上数据块的物理变化的记录。因此,如果您的1000万张记录散布在200万个街区中,那就是将产生多少WAL。通常,您还需要考虑查询可能引起的索引更新。真空过程还可以产生大量的WAL数据。

WAL is a record of physical changes to the blocks of data on disk. So if your 10 million records are scattered across 2 million blocks that is how much WAL will be generated. In general you would want to also consider and index updates a query might cause. The vacuum process can also generate substantial WAL data.

放低过去 2025-02-19 11:19:41

您每行将获得一个WAL记录。首次在检查点后修改的页面时,您将在WAL中获得完整页面图像(FPI),此后,只有修改的Xmax值才会记录。

You will get one WAL record per row. The first time a page it modified after a checkpoint you will get a full page image (FPI) in the WAL, after that only the modified xmax value will be logged.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文