Re: ToDo: fast update of arrays with fixed length fields for PL/pgSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ToDo: fast update of arrays with fixed length fields for PL/pgSQL
Date
Msg-id 21502.1385415209@sss.pgh.pa.us
Whole thread Raw
In response to ToDo: fast update of arrays with fixed length fields for PL/pgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: ToDo: fast update of arrays with fixed length fields for PL/pgSQL
List pgsql-hackers
Heikki Linnakangas <heikki@localhost.vmware.com> writes:
> In general, I'm not convinced this patch is worth the trouble. The 
> speedup isn't all that great; manipulating large arrays in PL/pgSQL is 
> still so slow that if you care about performance you'll want to rewrite 
> your function in some other language or use temporary tables. And you 
> only get a gain with arrays of fixed-length element type with no NULLs.

> So I think we should drop this patch in its current form. If we want to 
> make array manipulation in PL/pgSQL, I think we'll have to do something 
> similar to how we handle "row" variables, or something else entirely. 

I think that this area would be a fruitful place to make use of the
noncontiguous datatype storage ideas that we were discussing with the
PostGIS guys recently.  I agree that tackling it in the context of plpgsql
alone is not a good way to go at it.

I'm not saying this in a vacuum of information, either.  Some of the guys
at Salesforce have been poking at noncontiguous storage for arrays and
have gotten nice speedups --- but their patch is for plpgsql only and
only addresses arrays, which makes it enough of a kluge that I've not
wanted to bring it to the community.  I think we should work towards
a general solution instead.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Cube extension split algorithm fix
Next
From: Mark Kirkwood
Date:
Subject: Re: why semicolon after begin is not allowed in postgresql?