Re: Concatenate performance question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Guyver" <kenevel(at)googlemail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Concatenate performance question
Date: 2006-12-03 18:37:40
Message-ID: 21748.1165171060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Michael Guyver" <kenevel(at)googlemail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message brian 2006-12-03 19:40:26 Re: Restore database from files (not dump files)?
Previous Message Niederland 2006-12-03 17:18:14 vacuum in standalone mode