Re: [GENERAL] Concatenate performance question

2006-12-06 Thread Michael Guyver
On 03/12/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Michael Guyver" <[EMAIL PROTECTED]> 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 ve

Re: [GENERAL] Concatenate performance question

2006-12-03 Thread Tom Lane
"Michael Guyver" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION test_v_01() RETURNS VARCHAR AS $$ > DECLARE > buffer varchar; > i int4; > BEGIN > buffer := 'the quick brown fox jumps over the lazy dog'; > FOR i IN 1..1000 LOOP > buffer := buffer || 't

Re: [GENERAL] Concatenate performance question

2006-12-03 Thread Tom Lane
"Michael Guyver" <[EMAIL PROTECTED]> 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

Re: [GENERAL] Concatenate performance question

2006-12-03 Thread Michael Guyver
Gents, At risk of answering my own question to spur someone actually to share their thoughts on this topic, I thought I'd provide a quick look at the performance of the alternatives: either using the || operator, or the array_append method. -- SELECT * FROM test_v_01(); -- SELECT * FROM test_v_0