"Peter T. Breuer" <ptb@inv.it.uc3m.es> writes:
> "Also sprach Tom Lane:"
>> Except that in the situation you're describing, there's only a hundred
>> or two bytes of response to each query, which means that only one send()
>> will occur anyway. (The flush call comes only when we are done
>> responding to the current client query.)
> It may still be useful. The kernel won't necessarily send data as you
> push it down to the network protocols and driver. The driver may decide
> to wait for more data to accumulate,
No, because we set TCP_NODELAY. Once we've flushed a message to the
kernel, we don't want the kernel sitting on it --- any delay there adds
directly to the elapsed query time. At least this is the case for the
final response to a query. I'm not too clear on whether this means we
need to be careful about intermediate message boundaries when there's a
lot of data being sent.
regards, tom lane