Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seX8T-008QtM-IL for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Aug 2024 09:51:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1seX8R-00FklD-C1 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Aug 2024 09:51:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seX8R-00Fkl5-0o for pgsql-hackers@lists.postgresql.org; Thu, 15 Aug 2024 09:51:11 +0000 Received: from forward500b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d500]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seX8L-004y0r-6G for pgsql-hackers@postgresql.org; Thu, 15 Aug 2024 09:51:10 +0000 Received: from mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net [IPv6:2a02:6b8:c10:2222:0:640:c513:0]) by forward500b.mail.yandex.net (Yandex) with ESMTPS id 2D30661176; Thu, 15 Aug 2024 12:51:03 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id xoEDSd6kCmI0-RHnZK6JY; Thu, 15 Aug 2024 12:51:02 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tantorlabs.com; s=mail; t=1723715462; bh=6hzbPI7eXegsX+6MO6iOt74SvxtwnCjcxttkYJT72HA=; h=In-Reply-To:Cc:Date:References:To:Subject:Message-ID:From; b=0w6eSoSzLUpu83NQKZ31LSGJp1UJlA349qtG1pMosC635SlJYb98sJVLaVnNvOX7W 416kAQgll7Bmu9ecATwMXbpC3DO9PORiXQ5sTLlVDJHuP/CCj4iY7t94vH1A7HRvTB d1zsdofc5vT9JXHzvoSnkvzyGbu1V9LGT8aNDc34= Authentication-Results: mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net; dkim=pass header.i=@tantorlabs.com Content-Type: multipart/alternative; boundary="------------qXexLa3F9tU6KJnZTPOsJsIT" Message-ID: <7ac0e5c5-86ca-4301-af5e-b107e4ff0a58@tantorlabs.com> Date: Thu, 15 Aug 2024 12:50:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Vacuum statistics To: Alena Rybakina , Andrei Zubkov Cc: pgsql-hackers , a.lepikhov@postgrespro.ru References: <53c47c2d-72a5-44f2-900c-9973b2af1808@tantorlabs.com> <4a902cea-54fb-41b5-b208-b84731a5f577@postgrespro.ru> Content-Language: en-US From: Ilia Evdokimov In-Reply-To: <4a902cea-54fb-41b5-b208-b84731a5f577@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------qXexLa3F9tU6KJnZTPOsJsIT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15.8.24 11:49, Alena Rybakina wrote: >> >> I have some suggestions: >> >> 1. pgstatfuncs.c in functions tuplestore_put_for_database() and >> tuplestore_put_for_relation you can remove 'nulls' array if >> you're sure that columns cannot be NULL. >> > We need to use this for tuplestore_putvalues function. With this > function, we fill the table with the values of the statistics. Ah, right! I'm sorry. >> 1. >> >> >> >> 2. These functions are almost the same and I would think of writing >> one function depending of type 'ExtVacReportType' >> > I'm not sure that I fully understand what you mean. Can you explain it > more clearly, please? Ah, I didn't notice that the size of all three tables is different. Therefore, it won't be possible to write one function instead of two to avoid code duplication. My mistake. --------------qXexLa3F9tU6KJnZTPOsJsIT Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 15.8.24 11:49, Alena Rybakina wrote:

I have some suggestions:

  1. pgstatfuncs.c in functions tuplestore_put_for_database() and tuplestore_put_for_relation you can remove 'nulls' array if you're sure that columns cannot be NULL.
We need to use this for tuplestore_putvalues function. With this function, we fill the table with the values of the statistics.

Ah, right! I'm sorry.



  1. These functions are almost the same and I would think of writing one function depending of type 'ExtVacReportType'
I'm not sure that I fully understand what you mean. Can you explain it more clearly, please?


Ah, I didn't notice that the size of all three tables is different. Therefore, it won't be possible to write one function instead of two to avoid code duplication. My mistake.



--------------qXexLa3F9tU6KJnZTPOsJsIT--