Re: 64-bit API for large object

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 64-bit API for large object
Date: 2012-08-29 02:48:12
Message-ID: 24983.1346208492@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <ishii(at)postgresql(dot)org> writes:
> Correct me if I am wrong.
> After expanding large object API to 64-bit, the max size of a large
> object will be 8TB(assuming 8KB default BLKSZ).

> large object max size = pageno(int32) * LOBLKSIZE
> = (2^32-1) * (BLCKSZ / 4)
> = (2^32-1) * (8192/4)
> = 8TB

> I just want to confirm my calculation is correct.

pg_largeobject.pageno is a signed int, so I don't think we can let it go
past 2^31-1, so half that.

We could buy back the other bit if we redefined the column as oid
instead of int4 (to make it unsigned), but I think that would create
fairly considerable risk of confusion between the loid and pageno
columns (loid already being oid). I'd just as soon not go there,
at least not till we start seeing actual field complaints about
4TB being paltry ;-)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2012-08-29 02:51:20 Re: 64-bit API for large object
Previous Message Tom Lane 2012-08-29 02:42:18 Re: "default deny" for roles