Re: BUG #17896: xmlagg exponentially slower than string_agg equivalent - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17896: xmlagg exponentially slower than string_agg equivalent
Date
Msg-id 1701648.1681569942@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17896: xmlagg exponentially slower than string_agg equivalent  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> Also, while string_agg() seems to scale linearly (O(n)), xmlagg() seems to
> scale somewhat steeper (O(n^2)?).

Yeah, string_agg was optimized long ago to avoid repeat data copying,
but xmlagg hasn't been.

It looks like xmlagg doesn't make any direct use of libxml, which suggests
that this wouldn't be terribly hard to fix if somebody were motivated
to try.  The xml type is a bit of a development backwater though ...

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17898: Build failure when strip is LLVM's version
Next
From: Dmitry Dolgov
Date:
Subject: Re: BUG #17897: Crash on assignment to array of constraint-less domain over composite type