Skip site navigation (1) Skip section navigation (2)

Re: Performance Enhancement/Fix for Array Utility Functions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Mike Lewis <mikelikespie(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Farina <drfarina(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance Enhancement/Fix for Array Utility Functions
Date: 2010-07-29 19:29:40
Message-ID: AANLkTimY87Z6n+SnBAiP+vDbM4v7=tKeqHLxxJd9qgqC@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Jul 28, 2010 at 1:20 AM, Mike Lewis <mikelikespie(at)gmail(dot)com> wrote:
>>
>> > 1. As-is, it's a significant *pessimization* for small arrays, because
>> > the heap_tuple_untoast_attr_slice code does a palloc/copy even when one
>> > is not needed because the data is already not toasted.  I think there
>> > needs to be a code path that avoids that.
>>
>> This seems like it shouldn't be too hard to fix, and I think it should be
>> fixed.
>
> Do you have any suggestions where to start?  I do agree that this should be
> fixed as well.   I don't have too much time to dedicate to this project.  I
> can try to put in some time this weekend though if it isn't looking too bad.

Perhaps you could check VARATT_IS_EXTENDED.  If that's true, then
slice it, but if it's false, then just use the original datum.  You
might want to wrap that up in a function rather than cramming it all
in the macro definition, though.

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

In response to

Responses

pgsql-hackers by date

Next:From: Alexander KorotkovDate: 2010-07-29 19:38:56
Subject: Re: knngist - 0.8
Previous:From: Robert HaasDate: 2010-07-29 18:35:12
Subject: Re: reducing NUMERIC size for 9.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group