Re: COPY performance vs insert

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: COPY performance vs insert
Дата
Msg-id 20200317210225.GA17915@momjian.us
обсуждение исходный текст
Ответ на COPY performance vs insert  (PG Doc comments form <noreply@postgresql.org>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 9.4. String Functions and Operators page does not document thatencode adds line breaks
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_buffercache query example results misleading, grouping byjust relname, needs schema_name