[英]pg_class OID exhaustion by frequently creating temporary tables
Does PostgreSQL have mechanism of dealing with rapidly growing OID
counter on pg_catalog.pg_class table especially when that counter ticks over the maximum number of unique integer values. PostgreSQL 是否具有处理 pg_catalog.pg_class 表上快速增长的
OID
计数器的机制,尤其是当该计数器超过唯一整数值的最大数量时。
I have a very busy database with many concurrent processes that rely on frequently creating temporary tables via CREATE TEMP TABLE ... ON COMMIT DROP
.我有一个非常繁忙的数据库,其中包含许多并发进程,这些进程依赖于通过
CREATE TEMP TABLE ... ON COMMIT DROP
频繁创建临时表。 Most of transactions are very short and temp tables are automatically dropped at the end but the counter on pg_catalog.pg_class.oid
is rapidly moving forward.大多数事务都很短,临时表会在最后自动删除,但
pg_catalog.pg_class.oid
上的计数器正在快速前进。
What is going to happen when that counter makes a complete "circle around the integer"?当该计数器完整地“围绕整数圈”时会发生什么? Will it intelligently avoid collisions and if so will it come at a cost of performance or other negative side effects?
它会智能地避免碰撞吗?如果是这样,它会以性能或其他负面影响为代价吗?
I perused PostgreSQL documentation and found information about OID
transaction wraparound but no references to what happens when pg_catalog
tables exhaust all IODs.我仔细阅读了 PostgreSQL 文档并找到了有关
OID
事务环绕的信息,但没有提到当pg_catalog
表耗尽所有 IOD 时会发生什么。
OID wraparound is not your worry. OID 环绕不是您的担心。 PostgreSQL will avoid collisions when assigning and OID to a table.
PostgreSQL 将在为表分配 OID 时避免冲突。
You problem may be table bloat.你的问题可能是表膨胀。 Whenever a temporary table is created and removed, this causes dead tuples in the
pg_attributes
tables.每当创建和删除临时表时,都会导致
pg_attributes
表中的死元组。 So you should make sure that that catalog table is vacuumed aggressively (low autovacuum_vacuum_cost_delay
) so that it doesn't bloat.所以你应该确保该目录表被积极地
autovacuum_vacuum_cost_delay
(低autovacuum_vacuum_cost_delay
),这样它就不会膨胀。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.