pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PQresultMemorySize of ResultSet larger than expected
Date: Thu, 10 Mar 2022 10:00:18 -0500
Message-ID: <637625.1646924418@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh--zw3aZbJVKsRUqJGfPCjkGtcJ2_AmbVoNw3WhDzEztnQ@mail.gmail.com>
References: <CAFCRh--zw3aZbJVKsRUqJGfPCjkGtcJ2_AmbVoNw3WhDzEztnQ@mail.gmail.com>

Dominique Devienne <ddevienne@gmail.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





view thread (2+ messages)

Message-ID: <637625.1646924418@sss.pgh.pa.us>
Permalink:  ../637625.1646924418@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/637625.1646924418@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ddevienne@gmail.com
  Subject: Re: PQresultMemorySize of ResultSet larger than expected
  In-Reply-To: <637625.1646924418@sss.pgh.pa.us>
  References: <CAFCRh--zw3aZbJVKsRUqJGfPCjkGtcJ2_AmbVoNw3WhDzEztnQ@mail.gmail.com> <637625.1646924418@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox