> 22 нояб. 2022 г., в 17:10, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> написал(а):
>
> Hi Illya,
>
> On Mon, Nov 21, 2022 at 8:50 PM Ilya Gladyshev
> <ilya.v.gladyshev@gmail.com> wrote:
>>
>> Hi everyone,
>>
>> I have made a patch that introduces support for libpq binary protocol
>> in postgres_fdw. The idea is simple, when a user knows that the foreign
>> server is binary compatible with the local and his workload could
>> somehow benefit from using binary protocol, it can be switched on for a
>> particular server or even a particular table.
>>
>
> Why do we need this feature? If it's for performance then do we have
> performance numbers?
Yes, it is for performance, but I am yet to do the benchmarks. My initial idea was that binary protocol must be more
efficientthan text, because as I understand that’s the whole point of it. However, the minor tests that I have done do
notprove this and I couldn’t find any benchmarks for it online, so I will do further tests to find a use case for it.
> About the patch itself, I see a lot of if (binary) {} else {} block
> which are repeated. It will be good if we can add functions/macros to
> avoid duplication.
Yea, that’s true, I have some ideas about improving it