Re: bytea vs. pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: bytea vs. pg_dump
Date: 2009-05-06 14:19:31
Message-ID: 4725.1241619571@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Bernd Helmle wrote:
>> I'm dumb: I don't understand why a hex conversion would be
>> significantly faster than what we have now?

> Quite apart from anything else you would not need the current loop over
> the bytea input to calculate the result length - in hex it would just be
> the input length * 2.

Another point is that the current format results in a very large number
of backslashes in the output data, which translates to extra time and
space at the level of the COPY protocol itself (since that has to double
all those backslashes).

Of course, base64 would also have these two advantages.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2009-05-06 14:45:44 text_pattern_ops and complex regexps
Previous Message Andrew Chernow 2009-05-06 14:14:55 Re: bytea vs. pg_dump