Thread: Large tables being split at 1GB boundary

Large tables being split at 1GB boundary

From
Ron Johnson
Date:
Hi.

I have a table whose pg_class.relfilenode is, as you can
tell, 619703, and I see that pg 7.2.1 automagically splits
the makes a new container file at the exact 1GiB mark.

$ ls -aFl 619703*
-rw------- 1 postgres postgres 1073741824 May 21 13:38 619703
-rw------- 1 postgres postgres 1073741824 May 21 02:05 619703.1
-rw------- 1 postgres postgres 1073741824 May 21 13:39 619703.2
-rw------- 1 postgres postgres 1073741824 May 21 14:19 619703.3
-rw------- 1 postgres postgres 234250240 May 21 15:09 619703.4

Apart from allowing me to spread large tables across multiple
drives using symlinks (that _is_ the preferred method, correct?),
what is the reason for splitting filenodes at the 1GB mark?
Why not 2GB (2^31).

Thanks,
Ron
--
+---------------------------------------------------------+
| Ron Johnson, Jr.        Home: ron.l.johnson@cox.net     |
| Jefferson, LA  USA      http://ronandheather.dhs.org:81 |
|                                                         |
| "I have created a government of whirled peas..."        |
|   Maharishi Mahesh Yogi, 12-May-2002,                   |
!   CNN, Larry King Live                                  |
+---------------------------------------------------------+


Re: Large tables being split at 1GB boundary

From
Tom Lane
Date:
Ron Johnson <ron.l.johnson@cox.net> writes:
> what is the reason for splitting filenodes at the 1GB mark?
> Why not 2GB (2^31).

Some platforms fail on files >= 2GB.  Maybe it's only > 2GB,
or maybe there is funny boundary behavior.  We didn't see any
point in taking a risk.

            regards, tom lane