简体   繁体   English

频繁创建临时表导致 pg_class OID 耗尽

[英]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.

相关问题 在 pg_class 中找不到临时表 - Can't find temporary table in pg_class 创建临时表不会导致pg_class表碎片 - Does creating a temp table cause the pg_class table to fragment 如何将 postgres pg_class reltablespace 设置为实际值,而不是 0? - How to set postgres pg_class reltablespace to the actual value, not 0? 什么是Postgres中的pg_class,以及如何使用pgAdmin 4看到它? - What is pg_class in Postgres and how to see it using pgAdmin 4? oid 和 bytea 正在表中创建系统 - oid and bytea are creating system in tables "<i>Could not complete schema update: org.h2.jdbc.JdbcSQLException: Table &quot;PG_CLASS&quot; not found;<\/i>无法完成架构更新:org.h2.jdbc.JdbcSQLException:找不到表“PG_CLASS”;<\/b> <i>SQL statement<\/i> SQL 语句<\/b>" - Could not complete schema update: org.h2.jdbc.JdbcSQLException: Table "PG_CLASS" not found; SQL statement 损坏的pg_class数据? 不存在的表上的重影索引 - corrupted pg_class data? ghost index on non-existent table 如果表意外从 pg_class 中删除,那么如何从备份中恢复它? - If a table is dropped from pg_class accidentally then how to restore it from backup? 如何在 pg_class 中为 object 创建日期转储添加新列 - how to add new column in pg_class for object creation date dumping pg_largeobject 巨大,但没有表具有 OID 列类型 - pg_largeobject huge, but no tables have OID column type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM