Thank you for your reply! Yes, you are right there will be a separate call to send the data, but is copying data each time more costly operation than just one syscall?
Besides, if we already have a ready message packet to be sent why should we wait? Waiting for your reply, Best regards! On Thu, Mar 5, 2020 at 13:10 Tom Lane <t...@sss.pgh.pa.us> wrote: > Aleksei Ivanov <iv.aleks...@gmail.com> writes: > > I am really curious what was the original intention of using the > > PqSendBuffer and is it possible to remove it now. > > > Currently all messages are copied from StringInfo to this buffer and > sent, > > which from my point of view is redundant operation. > > That would mean doing a separate send() kernel call for every few bytes, > no? I think the point of that buffer is to be sure we accumulate a > reasonable number of bytes to pass to the kernel for each send(). > > regards, tom lane >