Re: LibPQ: PQresultMemorySize as proxy to transfered bytes

2023-11-22 Thread Alvaro Herrera
On 2023-Jun-28, Dominique Devienne wrote: > And if there's a better proxy to programmatically know the network > traffic exchanged on the connection's socket, that's cross-platform? > Obviously > libpq itself knows, but I don't see any way to access that info. > > Perhaps tracing might? But will

Re: LibPQ: PQresultMemorySize as proxy to transfered bytes

2023-06-29 Thread Dominique Devienne
On Wed, Jun 28, 2023 at 1:22 PM Tom Lane wrote: > I wrote: > > That number is the total space actually requested from malloc() for > > the PGresult object. But we request space in blocks (typically 2KB > > each), so there's some overhead due to fields not exactly filling > > a block, unused spac

Re: LibPQ: PQresultMemorySize as proxy to transfered bytes

2023-06-28 Thread Tom Lane
I wrote: > That number is the total space actually requested from malloc() for > the PGresult object. But we request space in blocks (typically 2KB > each), so there's some overhead due to fields not exactly filling > a block, unused space in the last block, etc. If you're testing > with very sma

Re: LibPQ: PQresultMemorySize as proxy to transfered bytes

2023-06-28 Thread Tom Lane
Dominique Devienne writes: > Obviously from these results, I now realize PQresultMemorySize() returns > something larger than what went across the network. Can someone explain > how so? That number is the total space actually requested from malloc() for the PGresult object. But we request space