Re: [GENERAL] storing C binary array in bytea via libpq - Mailing list pgsql-general

From Merlin Moncure
Subject Re: [GENERAL] storing C binary array in bytea via libpq
Date
Msg-id CAHyXU0xQYvuqoEvE=pGcEDQUD7BRSVJn7onhHOLJ+ftDhbyzaw@mail.gmail.com
Whole thread Raw
In response to Re: storing C binary array in bytea via libpq  (Tom DalPozzo <t.dalpozzo@gmail.com>)
List pgsql-general
On Wed, Dec 7, 2016 at 4:10 AM, Tom DalPozzo <t.dalpozzo@gmail.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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Multidimentional array access
Next
From: Tom DalPozzo
Date:
Subject: [GENERAL] SELECT slow immediately after many update or delete+insert, exceptusing WHERE .. IN