Log Message:
-----------
Fix performance issues in replace_text(), replace_text_regexp(), and
text_to_array(): they all had O(N^2) behavior on long input strings in
multibyte encodings, because of repeated rescanning of the input text to
identify substrings whose positions/lengths were computed in characters
instead of bytes. Fix by tracking the current source position as a char
pointer as well as a character-count. Also avoid some unnecessary palloc
operations. text_to_array() also leaked memory intracall due to failure
to pfree temporary strings. Per gripe from Tatsuo Ishii.
Modified Files:
--------------
pgsql/src/backend/utils/adt:
varlena.c (r1.152 -> r1.153)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c.diff?r1=1.152&r2=1.153)
pgsql-committers by date
| Next: | From: Tom Lane | Date: 2006-11-08 19:24:38 |
| Subject: pgsql: Tweak accumArrayResult() to double the size of its working arrays |
| Previous: | From: Neil Conway | Date: 2006-11-08 19:06:15 |
| Subject: pgsql: Fix two typos. |