pgsql: Fix performance issues in replace_text(), replace_text_regexp(),

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix performance issues in replace_text(), replace_text_regexp(),
Дата
Msg-id 20061108192225.371439FB26B@postgresql.org
обсуждение исходный текст
Список pgsql-committers
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 по дате отправления:

Предыдущее
От: neilc@postgresql.org (Neil Conway)
Дата:
Сообщение: pgsql: Fix two typos.
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Tweak accumArrayResult() to double the size of its working arrays