Re: PQresultMemorySize of ResultSet larger than expected

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PQresultMemorySize of ResultSet larger than expected
Date: 2022-03-10 15:00:18
Message-ID: 637625.1646924418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne <ddevienne(at)gmail(dot)com> writes:
> I've instrumented by libpq code, to show the byte size of the result-set.
> And I'm suprised that it's never smaller than 2,264 bytes, then the next
> size I see is 3,288, etc... Even when receiving no rows at all, in fact.

See PGRESULT_DATA_BLOCKSIZE and associated comments, starting about
line 90 in fe-exec.c. I don't recall whether there was any specific
motivation for PGRESULT_DATA_BLOCKSIZE to be 2K rather than some
other value; but it wouldn't do for it to be very small.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message George Woodring 2022-03-10 15:44:40 foreign key on delete cascade order?
Previous Message Bharath Rupireddy 2022-03-10 14:27:23 Re: primary_conninfo and restore_command ?