v8-0004-Documentation-for-parallel-copy.patch

text/x-patch

Filename: v8-0004-Documentation-for-parallel-copy.patch
Type: text/x-patch
Part: 3
Message: Re: Parallel copy

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v8-0004
Subject: Documentation for parallel copy.
File+
doc/src/sgml/ref/copy.sgml 31 0
From 16755acf139da5fb449daac2e0baed0a647b4086 Mon Sep 17 00:00:00 2001
From: Vignesh C <vignesh21@gmail.com>
Date: Sat, 1 Aug 2020 09:00:36 +0530
Subject: [PATCH v8 4/6] Documentation for parallel copy.

This patch has the documentation changes for parallel copy.
---
 doc/src/sgml/ref/copy.sgml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 369342b..328a5f1 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -37,6 +37,7 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
     DELIMITER '<replaceable class="parameter">delimiter_character</replaceable>'
     NULL '<replaceable class="parameter">null_string</replaceable>'
     HEADER [ <replaceable class="parameter">boolean</replaceable> ]
+    PARALLEL <replaceable class="parameter">integer</replaceable>
     QUOTE '<replaceable class="parameter">quote_character</replaceable>'
     ESCAPE '<replaceable class="parameter">escape_character</replaceable>'
     FORCE_QUOTE { ( <replaceable class="parameter">column_name</replaceable> [, ...] ) | * }
@@ -277,6 +278,22 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
    </varlistentry>
 
    <varlistentry>
+    <term><literal>PARALLEL</literal></term>
+    <listitem>
+     <para>
+      Perform <command>COPY FROM</command> in parallel using <replaceable
+      class="parameter">integer</replaceable> background workers.  Please
+      note that it is not guaranteed that the number of parallel workers
+      specified in <replaceable class="parameter">integer</replaceable> will
+      be used during execution.  It is possible for a copy to run with fewer
+      workers than specified, or even with no workers at all (for example,
+      due to the setting of max_worker_processes). This option is allowed
+      only in <command>COPY FROM</command>.
+     </para>
+    </listitem>
+   </varlistentry>
+
+   <varlistentry>
     <term><literal>QUOTE</literal></term>
     <listitem>
      <para>
@@ -953,6 +970,20 @@ COPY country FROM '/usr1/proj/bray/sql/country_data';
   </para>
 
   <para>
+   To copy data parallelly from a file into the <literal>country</literal> table:
+<programlisting>
+COPY country FROM '/usr1/proj/bray/sql/country_data' WITH (PARALLEL 1);
+</programlisting>
+  </para>
+
+  <para>
+   To copy data parallelly from STDIN into the <literal>country</literal> table:
+<programlisting>
+COPY country FROM STDIN WITH (PARALLEL 1);
+</programlisting>
+  </para>
+
+  <para>
    To copy into a file just the countries whose names start with 'A':
 <programlisting>
 COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy';
-- 
1.8.3.1