Re: 4 billion record limit?

From: Paul Caskey <paul(at)nmxs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>, Postgres Users <pgsql-general(at)postgresql(dot)org>
Subject: Re: 4 billion record limit?
Date: 2000-07-25 16:47:59
Message-ID: 397DC4BF.2F28678@nmxs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Tom Lane wrote:
>
> Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au> writes:
> > Paul Caskey wrote:
> >> 1. This implies a hard limit of 4 billion records on a server, right?
>
> > Basically, yes.
>
> It's only a hard limit if your application assumes OIDs are unique.
> If you don't assume that, then I think it's not a big problem.
>
> It's possible (though obviously not especially likely) that you might
> get OID collisions in the system tables after an OID-counter wraparound.

This implies they do wrap around. So they are reused? Chris said no, but
you're saying yes.

(Maybe they wrap around "by accident", by adding one to MAXINT, which will
give zero on an unsigned int, I believe. Will the system choke on zero?
Has anyone tested this wraparound?)

I will not have 4 billion records in one table or even one database. But
on a large server with many databases, it is conceivable to have 4 billion
records on one machine. With a lot of insert/delete activity, over a few
years, it is certainly conceivable to have 4 billion inserts. If the oids
don't wrap, I have a problem. I can ignore it for a long time, but it
will loom, like Y2K. :-)

Even if they do wrap, if I have some old records lying around with a low
OIDs, they will trip me up. Like you said, these are "the outer limits",
but I'm thinking ahead.

Someone suggested in private that I pg_dump/restore all my data to
"repack" the oids which start around 1700 on a fresh database. Thanks for
that idea. Also thanks, Tom, for the sanity check Re: terabytes of data
with 4 billion records. It's still possible, especially in coming years.
It would be a big feather in PG's cap to "fully support" 64-bit platforms
such as IRIX and Solaris (finally) and, coming soon to a theater near you,
Linux on IA-64.

--
Paul Caskey paul(at)nmxs(dot)com 505-255-1999
New Mexico Software 5041 Indian School NE Albuquerque, NM 87110
--

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michaël Fiey 2000-07-25 18:00:30 Comment #line after pre-processing
Previous Message Scott Holmes 2000-07-25 16:24:09 I wish to thank...

Browse pgsql-novice by date

  From Date Subject
Next Message Eduardo Kotujansky 2000-07-25 20:09:59 procedure language
Previous Message Jerome Raupach 2000-07-25 16:03:29 posgresql and C++