Re: Concatenate performance question - Mailing list pgsql-general

From Tom Lane
Subject Re: Concatenate performance question
Date
Msg-id 21748.1165171060@sss.pgh.pa.us
Whole thread Raw
In response to Re: Concatenate performance question  ("Michael Guyver" <kenevel@googlemail.com>)
Responses Re: Concatenate performance question
List pgsql-general
"Michael Guyver" <kenevel@googlemail.com> writes:
> ... Running the array_append version is faster by at least one order of
> magnitude in these examples.

Really?  I see only about a 50% advantage (155 msec vs 105 msec) in both
8.1 and 8.2.  What PG version are you running?  What database encoding
are you using?

To a zeroth-order approximation, the two methods should have about the
same amount of data copying involved, and so the concatenation method
ought to win out based on avoiding array data structure manipulation
overhead (not to mention avoiding the array_to_string step, which makes
an extra pass over all the data).  So I find my own results surprising,
and yours very much more so ...

            regards, tom lane

pgsql-general by date:

Previous
From: Mark Morgan Lloyd
Date:
Subject: Locking for function creation
Next
From: "shakahshakah@gmail.com"
Date:
Subject: trouble inserting into new partitions of partitioned tables