diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2012-12-01 12:54:20 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-12-01 12:54:20 +0000 |
commit | 8de72b66a2edcf12c812de0a73bd50b6b7d81d62 (patch) | |
tree | 3cb4fc55c3d70b7b972910cfeb22cbb7c704875a /doc/src | |
parent | 44c03efee3d15a1db3d64bc5a2da91c145a91873 (diff) | |
download | postgresql-8de72b66a2edcf12c812de0a73bd50b6b7d81d62.tar.gz postgresql-8de72b66a2edcf12c812de0a73bd50b6b7d81d62.zip |
COPY FREEZE and mark committed on fresh tables.
When a relfilenode is created in this subtransaction or
a committed child transaction and it cannot otherwise
be seen by our own process, mark tuples committed ahead
of transaction commit for all COPY commands in same
transaction. If FREEZE specified on COPY
and pre-conditions met then rows will also be frozen.
Both options designed to avoid revisiting rows after commit,
increasing performance of subsequent commands after
data load and upgrade. pg_restore changes later.
Simon Riggs, review comments from Heikki Linnakangas, Noah Misch and design
input from Tom Lane, Robert Haas and Kevin Grittner
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/copy.sgml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index b2a6dd797ce..6d34c319888 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -34,6 +34,7 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable FORMAT <replaceable class="parameter">format_name</replaceable> OIDS [ <replaceable class="parameter">boolean</replaceable> ] + FREEZE [ <replaceable class="parameter">boolean</replaceable> ] DELIMITER '<replaceable class="parameter">delimiter_character</replaceable>' NULL '<replaceable class="parameter">null_string</replaceable>' HEADER [ <replaceable class="parameter">boolean</replaceable> ] @@ -182,6 +183,28 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable </varlistentry> <varlistentry> + <term><literal>FREEZE</literal></term> + <listitem> + <para> + Specifies copying the data with rows already frozen, just as they + would be after running the <command>VACUUM FREEZE</> command. + This is intended as a performance option for initial data loading. + Rows will be frozen only if the table being loaded has been created + in the current subtransaction, there are no cursors open and there + are no older snapshots held by this transaction. If those conditions + are not met the command will continue without error though will not + freeze rows. + </para> + <para> + Note that all sessions will immediately be able to see the data + once it has been successfully loaded. This violates the normal rules + of MVCC visibility and by specifying this option the user acknowledges + explicitly that this is understood. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><literal>DELIMITER</literal></term> <listitem> <para> |