Re: COPY performance vs insert - Mailing list pgsql-docs

From Bruce Momjian
Subject Re: COPY performance vs insert
Date
Msg-id 20200317210225.GA17915@momjian.us
Whole thread Raw
In response to COPY performance vs insert  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
On Wed, Feb 12, 2020 at 09:25:05AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/12/populate.html
> Description:
> 
> I think this could be clearer. In particular, performance of COPY vs INSERT
> from a query (INSERT INTO ... SELECT FROM ...) or INSERT with a list of rows
> (INSERT INTO ... VALUES (), (), (), ...)
> Is there any performance benefit with COPY in those cases?

COPY input/outputs rows in bulk, so it is still faster to do COPY than
INSERT INTO ... SELECT FROM or INSERT INTO ... VALUES.  You can run
tests to prove it.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 9.4. String Functions and Operators page does not document thatencode adds line breaks
Next
From: Bruce Momjian
Date:
Subject: Re: pg_buffercache query example results misleading, grouping byjust relname, needs schema_name