Re: pg_toast oid limits - Mailing list pgsql-admin

From Tom Lane
Subject Re: pg_toast oid limits
Date
Msg-id 10802.1477521336@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_toast oid limits  (Natalie Wenz <nataliewenz@ebureau.com>)
List pgsql-admin
Natalie Wenz <nataliewenz@ebureau.com> writes:
> I'm a little confused about the limit. Is it 4 billion oids for the whole database, or just per table? I keep coming
backto this line, from https://wiki.postgresql.org/wiki/TOAST :  

Per table --- the problem is you need a unique 4-byte chunk_id for each
toasted field value.

> "If you exceed 4 billion of these rows across all tables (remember this is a global shared wrapping counter), then
theOID counter "wraps" which might cause significant slowdown as you approach the 4B row limit." 

Um.  That could use improvement, couldn't it.  The numbers are sourced
from a global counter, but as the counter wraps around it's possible for
the same number to be re-used in different toast tables.  You only start
to see a problem when the density of already-used numbers in a particular
toast table gets too high, so that the system has to spend a long time
searching for the next free number.

            regards, tom lane


pgsql-admin by date:

Previous
From: Natalie Wenz
Date:
Subject: Re: pg_toast oid limits
Next
From: Poul Kristensen
Date:
Subject: Notifications from postgresql.org