pgsql: Speed up uuid_out() by not relying on a StringInfo

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Speed up uuid_out() by not relying on a StringInfo
Дата
Msg-id E1rcxVE-0003eI-1V@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Speed up uuid_out() by not relying on a StringInfo

Since the size of the string representation of an uuid is fixed, there
is no benefit in using a StringInfo.  This commit simplifies uuid_oud()
to not rely on a StringInfo, where avoiding the overhead of the string
manipulation makes the function substantially faster.

A COPY TO on a relation with one UUID attribute can show up to a 40%
speedup when the bottleneck is the COPY computation with uuid_out()
showing up at the top of the profiles (numbered measure here, Laurenz
has mentioned something closer to 20% faster runtimes), for example when
the data is fully in shared buffers or the OS cache.

Author: Laurenz Albe
Reviewed-by: Andres Freund, Michael Paquier
Description: https://postgr.es/m/679d5455cbbb0af667ccb753da51a475bae1eaed.camel@cybertec.at

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/011d60c4352c5c48c0f1a185e8a12833c22a58db

Modified Files
--------------
src/backend/utils/adt/uuid.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Add lookup table for replication slot conflict reasons
Следующее
От: Amit Kapila
Дата:
Сообщение: pgsql: Improve ERROR/LOG messages added by commits ddd5f4f54a and 7a424