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

[GENERAL] Concatenate performance question

2006-11-29 Thread Michael Guyver
Hi there, I've got a rather large PL/pgSQL function which returns a varchar (though it could be text, char or blob, I'm not fussy) containing JSON information (where JSON is Javascript Object Notation). The middle tier of the app does pretty much sweet FA except pass this straight back to the cli