Re: Re: patch: fix performance problems with repated decomprimation of varlena values in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: patch: fix performance problems with repated decomprimation of varlena values in plpgsql
Date: 2011-01-18 22:00:21
Message-ID: 3290.1295388021@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2011/1/18 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> I looked at this patch and found it fairly awkward. What is the point
>> of adding an additional flag to every variable, as opposed to just
>> forcibly detoasting during assignment?

> But detoasting on assignment isn't enought:

> for i in array_lower(a,1) .. array_upper(a,1)
> loop
> if x < a[i] then
> x = a[i];
> end if;
> end loop;

> in this cycle the variable a wasn't modified. Any access to this
> variable means a detoast and decompres.

How so? In what I'm envisioning, a would have been decompressed when it
was originally assigned to.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-01-18 22:04:16 Re: Fixing GIN for empty/null/full-scan cases
Previous Message Tom Lane 2011-01-18 21:58:15 Re: Fixing GIN for empty/null/full-scan cases