Re: Improving PostgreSQL insert performance

From: Frits Jalvingh <jal(at)etc(dot)to>
To: Nicolas Paris <niparisco(at)gmail(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Kenneth Marshall <ktm(at)rice(dot)edu>, Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Improving PostgreSQL insert performance
Date: 2017-06-10 20:37:48
Message-ID: CAKhTGFU=cQMawaaMvcb1V7_uXuscPQhwo2huF_5rSQ6WBkpqaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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.
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2017-06-11 02:32:14 Re: Improving PostgreSQL insert performance
Previous Message Nicolas Paris 2017-06-10 20:12:35 Re: Improving PostgreSQL insert performance