Re: storing C binary array in bytea via libpq

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom DalPozzo <t(dot)dalpozzo(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: storing C binary array in bytea via libpq
Date: 2016-12-09 15:31:21
Message-ID: CAHyXU0xQYvuqoEvE=pGcEDQUD7BRSVJn7onhHOLJ+ftDhbyzaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 7, 2016 at 4:10 AM, Tom DalPozzo <t(dot)dalpozzo(at)gmail(dot)com> wrote:
> Hi,
> I tried both ways: they're ok.
> Also, multiple VALUES in one INSERT is actually better as performance.

If you are chasing performance with the binary protocol you might want
to take a look at libpqtypes: http://libpqtypes.esilo.com/

It facilitates fast communication to/from the database. For
inserting, you stack an array of composites locally and send it to the
database with a single query and the receiving side can unwrap it and
do the insert in a function. Advancements in json handling have
largely displaced this kind of usage in many situations but if you
have extreme performance requirements it's still worth a look.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom DalPozzo 2016-12-09 16:03:22 SELECT slow immediately after many update or delete+insert, except using WHERE .. IN
Previous Message Tom Lane 2016-12-09 15:30:39 Re: Multidimentional array access