Обсуждение: pg_class.oid at 4B

Поиск
Список
Период
Сортировка

pg_class.oid at 4B

От
Radoslav Nedyalkov
Дата:
Hello all,
We have a busy database that has oid increasing with 50-100M  per month.
There is no oid type across user attributes anywhere nor user tables with oids;
Not sure where this generation comes from. If you can hint me, it would be great.
Also what happens when pg_class.oid reaches 4B.
pg_class itself is ~40K.

Thank you very much,
Rado

Re: pg_class.oid at 4B

От
"David G. Johnston"
Дата:
On Wednesday, October 20, 2021, Radoslav Nedyalkov <rnedyalkov@gmail.com> wrote:
Hello all,
We have a busy database that has oid increasing with 50-100M  per month.
There is no oid type across user attributes anywhere nor user tables with oids;
Not sure where this generation comes from. If you can hint me, it would be great.


Large objects?

Log ddl statements and see what kinds of create commands are produced in volume?

David J.

Re: pg_class.oid at 4B

От
Tom Lane
Дата:
Radoslav Nedyalkov <rnedyalkov@gmail.com> writes:
> We have a busy database that has oid increasing with 50-100M  per month.
> There is no oid type across user attributes anywhere nor user tables with
> oids;
> Not sure where this generation comes from. If you can hint me, it would be
> great.

Lots of short-lived temporary tables, maybe?

> Also what happens when pg_class.oid reaches 4B.

Nothing.  The counter will wrap around and you won't notice a thing.

            regards, tom lane



Re: pg_class.oid at 4B

От
Laurenz Albe
Дата:
On Wed, 2021-10-20 at 23:29 +0300, Radoslav Nedyalkov wrote:
> We have a busy database that has oid increasing with 50-100M  per month.
> There is no oid type across user attributes anywhere nor user tables with oids;
> Not sure where this generation comes from. If you can hint me, it would be great.
> Also what happens when pg_class.oid reaches 4B.
> pg_class itself is ~40K.

Hard to say, perhaps you are creating lots of temporary tables (watch out
for pg_attribute bloat!).  The OID counter will simply wrap around, but there
will be no duplicate OIDs in pg_class.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com