Re: [PERFORM] Improving PostgreSQL insert performance - Mailing list pgsql-performance

From Frits Jalvingh
Subject Re: [PERFORM] Improving PostgreSQL insert performance
Date
Msg-id CAKhTGFU=cQMawaaMvcb1V7_uXuscPQhwo2huF_5rSQ6WBkpqaA@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORM] Improving PostgreSQL insert performance  (Nicolas Paris <niparisco@gmail.com>)
List pgsql-performance
I think binary is worse.. according to the postgres documentation:

The binary format option causes all data to be stored/read as binary format rather than as text. It is somewhat faster than the text and CSV formats, but a binary-format file is less portable across machine architectures and PostgreSQL versions. Also, the binary format is very data type specific; for example it will not work to output binary data from a smallint column and read it into an integer column, even though that would work fine in text format.

By itself it is similar in badness as both require completely different semantics than insert..
On Sat, 10 Jun 2017 at 22:12, Nicolas Paris <niparisco@gmail.com> wrote:
> I tried the copy command, and that indeed works quite brilliantly:
> Inserted 24000000 rows in 22004 milliseconds, 1090710.7798582076 rows per
> second
>
> That's faster than Oracle. But with a very bad interface I have to say for
> normal database work.. I will try to make this work in the tooling, but it
> needs some very special code to format all possible values properly, and to
> manage the end of the copy, so it is not usable in general which is a pity, I
> think.

Have you thought about the COPY with binary format ? Thats looks more
robust than the text format you used in your benchmarks.

pgsql-performance by date:

Previous
From: Nicolas Paris
Date:
Subject: Re: [PERFORM] Improving PostgreSQL insert performance
Next
From: Alvaro Herrera
Date:
Subject: Re: [PERFORM] Improving PostgreSQL insert performance