Varlena and binary

Lists: pgsql-hackers
From: Radosław Smogura <mail(at)smogura(dot)eu>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Varlena and binary
Date: 2011-02-06 21:20:41
Message-ID: 201102062220.41452.mail@smogura.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I'm sending small patch for textsend. It reduces unnecessary copies, and
memory usage for duplication of varlena data. May you look?

Kind regards,
Radosław Smogura

Attachment Content-Type Size
varlena-perform.patch text/x-patch 1001 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Radosław Smogura <mail(at)smogura(dot)eu>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Varlena and binary
Date: 2011-02-07 16:12:07
Message-ID: 16683.1297095127@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?utf-8?q?Rados=C5=82aw_Smogura?= <mail(at)smogura(dot)eu> writes:
> I'm sending small patch for textsend. It reduces unnecessary copies, and
> memory usage for duplication of varlena data. May you look?

This code will break the day that text and bytea don't have the same
internal representation, which seems likely to be soon. Barring some
compelling evidence of a major performance improvement obtainable this
way, I don't think we want this patch.

regards, tom lane


From: Radosław Smogura <rsmogura(at)softperience(dot)eu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Varlena and binary
Date: 2011-02-07 21:57:39
Message-ID: 201102072257.39152.rsmogura@softperience.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Just from curious may I ask in which direction this will go, and how this will
affect performance of text and binary format?

Actually I started to make smaller improvements, and I think about one big to
encode text (when client and server encoding are different) directly to
StringInfo, without intermediate buffer.

Thanks in advice
Radek

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> Monday 07 February 2011 17:12:07
> =?utf-8?q?Rados=C5=82aw_Smogura?= <mail(at)smogura(dot)eu> writes:
> > I'm sending small patch for textsend. It reduces unnecessary copies, and
> > memory usage for duplication of varlena data. May you look?
>
> This code will break the day that text and bytea don't have the same
> internal representation, which seems likely to be soon. Barring some
> compelling evidence of a major performance improvement obtainable this
> way, I don't think we want this patch.
>
> regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Radosław Smogura <mail(at)smogura(dot)eu>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Varlena and binary
Date: 2011-02-08 02:28:05
Message-ID: AANLkTi=rkU+GC1Qg3owPgPhrtZFaHmmbzP5TVg688_3u@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 7, 2011 at 11:12 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> =?utf-8?q?Rados=C5=82aw_Smogura?= <mail(at)smogura(dot)eu> writes:
>> I'm sending small patch for textsend. It reduces unnecessary copies, and
>> memory usage for duplication of varlena data. May you look?
>
> This code will break the day that text and bytea don't have the same
> internal representation, which seems likely to be soon.

Oh, really?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company