Re: bytea vs. pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bytea vs. pg_dump
Date
Msg-id 4725.1241619571@sss.pgh.pa.us
Whole thread Raw
In response to Re: bytea vs. pg_dump  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch to fix search_path defencies with pg_bench
Next
From: Andrew Chernow
Date:
Subject: Re: bytea vs. pg_dump