Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSKHH-0005th-B7 for pgsql-general@arkaria.postgresql.org; Thu, 10 Mar 2022 15:00:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSKHF-0006FV-60 for pgsql-general@arkaria.postgresql.org; Thu, 10 Mar 2022 15:00:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSKHE-0006FK-RR for pgsql-general@lists.postgresql.org; Thu, 10 Mar 2022 15:00:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSKH8-0002oY-JS for pgsql-general@lists.postgresql.org; Thu, 10 Mar 2022 15:00:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 22AF0Ixq637626; Thu, 10 Mar 2022 10:00:19 -0500 From: Tom Lane To: Dominique Devienne cc: pgsql-general@lists.postgresql.org Subject: Re: PQresultMemorySize of ResultSet larger than expected In-reply-to: References: Comments: In-reply-to Dominique Devienne message dated "Thu, 10 Mar 2022 15:09:58 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <637624.1646924418.1@sss.pgh.pa.us> Date: Thu, 10 Mar 2022 10:00:18 -0500 Message-ID: <637625.1646924418@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne 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