1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Remove the recently added USE_SEGMENTED_FILES option, and indeed remove all

support for a nonsegmented mode from md.c.  Per recent discussions, there
doesn't seem to be much value in a "never segment" option as opposed to
segmenting with a suitably large segment size.  So instead provide a
configure-time switch to set the desired segment size in units of gigabytes.
While at it, expose a configure switch for BLCKSZ as well.

Zdenek Kotala
This commit is contained in:
Tom Lane
2008-05-02 01:08:27 +00:00
parent 94b0b545f8
commit 3c6248a828
8 changed files with 223 additions and 170 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.307 2008/04/21 00:26:44 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.308 2008/05/02 01:08:26 tgl Exp $ -->
<chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@ -1067,15 +1067,38 @@ su - postgres
</varlistentry>
<varlistentry>
<term><option>--disable-segmented-files</option></term>
<term><option>--with-segsize=<replaceable>SEGSIZE</replaceable></option></term>
<listitem>
<para>
Store large tables as single operating-system files, rather than
dividing them into 1GB segments as is the default. This option
is ignored unless the operating system has <quote>largefile</>
support (which most do, nowadays). It can be helpful to reduce
the number of file descriptors consumed when working with very
large tables.
Set the <firstterm>segment size</>, in gigabytes. Large tables are
divided into multiple operating-system files, each of size equal
to the segment size. This avoids problems with file size limits
that exist on many platforms. The default segment size, 1 gigabyte,
is safe on all supported platforms. If your operating system has
<quote>largefile</> support (which most do, nowadays), you can use
a larger segment size. This can be helpful to reduce the number of
file descriptors consumed when working with very large tables.
But be careful not to select a value larger than is supported
by your platform and the filesystem(s) you intend to use. Other
tools you might wish to use, such as <application>tar</>, could
also set limits on the usable file size.
It is recommended, though not absolutely required, that this value
be a power of 2.
Note that changing this value requires an initdb.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--with-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
<listitem>
<para>
Set the <firstterm>block size</>, in kilobytes. This is the unit
of storage and I/O within tables. The default, 8 kilobytes,
is suitable for most situations; but other values may be useful
in special cases.
The value must be a power of 2 between 1 and 32 (kilobytes).
Note that changing this value requires an initdb.
</para>
</listitem>
</varlistentry>

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.22 2008/03/10 20:06:27 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.23 2008/05/02 01:08:26 tgl Exp $ -->
<chapter id="storage">
@ -138,14 +138,13 @@ Avoid assuming that filenode and table OID are the same.
</caution>
<para>
When a table or index exceeds 1 GB, it is normally divided into gigabyte-sized
When a table or index exceeds 1 GB, it is divided into gigabyte-sized
<firstterm>segments</>. The first segment's file name is the same as the
filenode; subsequent segments are named filenode.1, filenode.2, etc.
This arrangement avoids problems on platforms that have file size limitations.
(But if the platform does not have such a limitation, and
<option>--disable-segmented-files</option> was specified when
<productname>PostgreSQL</> was built, then each table or index is stored
as a single file, without segmentation.)
(Actually, 1 GB is just the default segment size. The segment size can be
adjusted using the configuration option <option>--with-segsize</option>
when building <productname>PostgreSQL</>.)
The contents of tables and indexes are discussed further in
<xref linkend="storage-page-layout">.
</para>