PostgreSQL 中的最大事务大小 [英] Maximum transaction size in PostgreSQL

查看:38
本文介绍了PostgreSQL 中的最大事务大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个实用程序,我需要在其中执行 INSERT、UPDATE & 的批量加载.删除操作.我正在尝试围绕此创建事务,以便一旦调用此系统并将数据提供给它,就可以确保将其全部或不添加到数据库中.

I have a utility in my application where i need to perform bulk load of INSERT, UPDATE & DELETE operations. I am trying to create transaction around this so that once this system is invoke and the data is fed to it, it is ensured that it is either all or none added to the database.

关心的是这里的边界条件是什么?有多少 INSERT、UPDATE &DELETE 我可以在一笔交易中进行吗?交易大小是否可配置?

The concern what is have is what is the boundary conditions here? How many INSERT, UPDATE & DELETE can i have in one transaction? Is transaction size configurable?

推荐答案

我不认为在事务中可以执行的工作量是最大的.数据不断添加到表文件中,最终事务要么提交要么回滚:AIUI 这个结果被存储在 pg_clog 中;如果它回滚,空间最终会被真空回收.因此,例如,正在进行的事务工作并不是保存在内存中并在提交时刷新.

I don't think there's a maximum amount of work that can be performed in a transaction. Data keeps getting added to the table files, and eventually the transaction either commits or rolls backs: AIUI this result gets stored in pg_clog; if it rolls back, the space will eventually be reclaimed by vacuum. So it's not as if the ongoing transaction work is held in memory and flushed at commit time, for instance.

这篇关于PostgreSQL 中的最大事务大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆