Re: replace_text optimization (StringInfo to varlena)

2019-02-13 Thread Kyotaro HORIGUCHI
At Wed, 13 Feb 2019 16:38:50 +0100, "Daniel Verite" wrote in > Hi, > > replace_text() in varlena.c builds the result in a StringInfo buffer, > and finishes by copying it into a freshly allocated varlena structure > with cstring_to_text_with_len(), in the same memory context. > > It looks

replace_text optimization (StringInfo to varlena)

2019-02-13 Thread Daniel Verite
Hi, replace_text() in varlena.c builds the result in a StringInfo buffer, and finishes by copying it into a freshly allocated varlena structure with cstring_to_text_with_len(), in the same memory context. It looks like that copy step could be avoided by preprending the varlena header to the