replace_text() improvement

Поиск
Список
Период
Сортировка
От Atsushi Ogawa
Тема replace_text() improvement
Дата
Msg-id PIEMIKOOMKNIJLLLBCBBMEFOCIAA.a_ogawa@hi-ho.ne.jp
обсуждение исходный текст
Ответы Re: replace_text() improvement  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: replace_text() improvement  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
I made the patch that improved the performance of replace_text().
The content of the patch is as follows:

(1)Create shortcut when subtext was not found.

(2)Stop using LEFT and RIGHT macro.
In LEFT and RIGHT macro, TEXTPOS is executed by the same content as
execution immediately before. The execution frequency of TEXTPOS can be
reduced by using text_substring instead of LEFT and RIGHT macro.

(3)Add appendStringInfoText, and use it instead of appendStringInfoString.
There is an overhead of PG_TEXT_GET_STR when appendStringInfoString is
executed by text type. This can be reduced by appendStringInfoText.

(4)Reduce execution of TEXTDUP.

The effect of the patch that I measured is as follows:

- The Data for test was created by 'pgbench -i'.

- Test SQL:
 select replace(aid, '9', 'A') from accounts;

- Test results: Linux(CPU: Pentium III, Compiler option: -O2)
 original: 1.515s
 patched:  1.250s

regards,

---
Atsushi Ogawa

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: plpgsql raise - parameters can be expressions
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: patch to add krb_server_hostname to postgresql.conf