From: Andreas Schmitz <schmitz@occamlabs.de>
To: Maciek Sakrejda <msakrejda@truviso.com>
Cc: Florian Weimer <fweimer@bfk.de>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: bytea performance tweak
Date: Tue, 28 Jun 2011 01:49:57 +0200
Message-ID: <20110627234957.GA2653@summalogicae.occamlabs.local> (raw)
In-Reply-To: <BANLkTiki7we3y+jph9AUeiZwHpqiTyMx8g@mail.gmail.com>
References: <20110621130713.GB3919@summalogicae.occamlabs.local>
<BANLkTimryw=Sm5q4v53PQNkdi+RjAfgJBA@mail.gmail.com>
<20110622141711.GA2652@summalogicae.occamlabs.local>
<BANLkTimO_hQFR-5DwL5dZsMdS3XxD=WWQQ@mail.gmail.com>
<20110623100616.GA14152@summalogicae.occamlabs.local>
<82pqlzs7gt.fsf@mid.bfk.de>
<BANLkTiki7we3y+jph9AUeiZwHpqiTyMx8g@mail.gmail.com>
Maciek Sakrejda wrote:
Hi,
> >> Is there a timeline for fully supporting the binary protocol?
> >
> > A PostgreSQL installation can contain user-defined types with a custom
> > binary format, so this will not work with all databases anyway.
>
> Having to read unknown types in text mode is not any easier if you're
> going to do something interesting with them. In either case, the
> protocol provides a way to read the type payload off the wire (so,
> e.g., a column with a type you can't read won't "mess up" the whole
> result set), but it's up to you to process those bytes. As Vitalii
> stated, something like PGObject is probably the right way to handle
> this.
>
> > A way to tell PostgreSQL to always send some [types] in binary format
> > would solve this, though.
>
> (I assume you meant "types" not "times")
>
> Yep, that would be nice. There are per-*column* output facilities in
> the protocol, but not per-type. It's possible to ask the server for
> the columns in a query before you commit to output types, but that
> involves an extra round trip which won't be worth it most of the time
> (still, it could be worth it if you're doing something that outputs a
> lot of rows with far leaner binary representations for some data
> types). Perhaps per-statement encoding choice might be the right
> compromise, although that smells like a niche use case.
>
> What's the current state of the binary patch? The wiki (
> http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer ) doesn't say.
> With a brief look at the list archives, the last activity I see is a
> completely new patch submitted by Radosław Smogura, but that
> discussion peters out. That discussion implies we want a solution to
> the "which-types-to-encode-how" problem, but realistically, if we want
> that, we won't have binary support until the protocol changes to allow
> per-type encoding selection. Would a polished patch with
> all-or-nothing connection-flag-level binary support be acceptable?
so it seems to me that switching to the binary protocol is probably
going to be hard, without server side support. What about just applying
my patch in the meantime, including Oliver's fix of course?
Best regards, Andreas
Attachments:
signature.asc (application/pgp-signature, 197B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: schmitz@occamlabs.de, msakrejda@truviso.com, fweimer@bfk.de, oliver@opencloud.com
Subject: Re: bytea performance tweak
In-Reply-To: <20110627234957.GA2653@summalogicae.occamlabs.local>
References: <20110621130713.GB3919@summalogicae.occamlabs.local> <BANLkTimryw=Sm5q4v53PQNkdi+RjAfgJBA@mail.gmail.com> <20110622141711.GA2652@summalogicae.occamlabs.local> <BANLkTimO_hQFR-5DwL5dZsMdS3XxD=WWQQ@mail.gmail.com> <20110623100616.GA14152@summalogicae.occamlabs.local> <82pqlzs7gt.fsf@mid.bfk.de> <BANLkTiki7we3y+jph9AUeiZwHpqiTyMx8g@mail.gmail.com> <20110627234957.GA2653@summalogicae.occamlabs.local>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox