Re: [PATCH] pg_convert improvement

Поиск
Список
Период
Сортировка
От Drouvot, Bertrand
Тема Re: [PATCH] pg_convert improvement
Дата
Msg-id b0bfe9d0-9bd6-4c83-9953-dbf5b0b26774@gmail.com
обсуждение исходный текст
Ответ на [PATCH] pg_convert improvement  (Yurii Rashkovskii <yrashk@gmail.com>)
Ответы Re: [PATCH] pg_convert improvement  (Yurii Rashkovskii <yrashk@gmail.com>)
Список pgsql-hackers
Hi,

On 11/24/23 3:05 PM, Yurii Rashkovskii wrote:
> Hi,
> 
> I propose a patch that ensures `pg_convert` doesn't allocate and copy data when no conversion is done. It is an
unnecessary overhead,especially when such conversions are done frequently and for large values.
 
> 

+1 for the patch, I think the less is done the better.

> 
> Happy to hear any feedback!
> 

The patch is pretty straightforward, I just have one remark:

+       /* if no actual conversion happened, return the original string */
+       /* (we are checking pointers to strings instead of encodings because
+          `pg_do_encoding_conversion` above covers more cases than just
+          encoding equality) */

I think this could be done in one single comment and follow the preferred style
for multi-line comment, see [1].

[1]: https://www.postgresql.org/docs/current/source-format.html

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Adding facility for injection points (or probe points?) for more advanced tests
Следующее
От: Yurii Rashkovskii
Дата:
Сообщение: Re: [PATCH] pg_convert improvement