在大型删除或批处理语句中创建了多少个WAL日志?
假设我从表中删除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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.
您每行将获得一个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.