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 1sjKzR-00HQ5W-WF for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Aug 2024 15:53:46 +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 1sjKzO-006y6J-LE for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Aug 2024 15:53:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjKzO-006y69-BT for pgsql-hackers@lists.postgresql.org; Wed, 28 Aug 2024 15:53:42 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjKzL-001rm7-D0 for pgsql-hackers@lists.postgresql.org; Wed, 28 Aug 2024 15:53:41 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id E29EB43F9E for ; Wed, 28 Aug 2024 17:53:36 +0200 (CEST) Received: from s979.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id D31C645988; Wed, 28 Aug 2024 17:53:36 +0200 (CEST) Received: from s471.loopia.se (unknown [172.22.191.5]) by s979.loopia.se (Postfix) with ESMTP id D184A10BC3AB; Wed, 28 Aug 2024 17:53:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=proxel.se Received: from s981.loopia.se ([172.22.191.6]) by s471.loopia.se (s471.loopia.se [172.22.190.35]) (amavisd-new, port 10024) with LMTP id jRX1-lF1Cgpi; Wed, 28 Aug 2024 17:53:36 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 158.174.129.34 Received: from [192.168.0.189] (h-158-174-129-34.NA.cust.bahnhof.se [158.174.129.34]) (Authenticated sender: andreas@proxel.se) by s981.loopia.se (Postfix) with ESMTPSA id 6773A22B1739; Wed, 28 Aug 2024 17:53:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1724860416; bh=Dzy0Kn+4XhMNSH3Nopate2c2rBu8aLSN6HFcAuBn7jI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=aAjJMhBRhu6CU3HhlCntO4WisRcLZILZGNgL6Un/co3ZX2TmjxpTA5aO+gwE06MNn CgetQtk57zxeO8N6ZK+YEybPtK7ky5WisxTX04lPfrJb+CfwqVhUUcjGmop05ixqtR Ga25H58pi1OegR4DUM2L74beYUdwzPt+/9DM4xrjrEIMWsb6MPHBRKI+3BgLXx9dNU gNikV2vBVYzbbYjLgosQrFBtwROiT78PKg1bTSEZuDJNf7SIM+exdoZCplzsaFhr6R LCn2RIAmWTXTM+gglaqnEX4so1eSrAyY+Cr+h9RUC8ZEROkS3VPtB/K5YfEG3rk33r kSuSLJUjtPoNQ== Message-ID: Date: Wed, 28 Aug 2024 17:53:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PATCH: Add hooks for pg_total_relation_size and pg_indexes_size To: Abdoulaye Ba Cc: pgsql-hackers@lists.postgresql.org References: <15ee4989-c366-4d1b-95a6-d8a49b14aaf5@proxel.se> Content-Language: en-US From: Andreas Karlsson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/9/24 6:59 PM, Abdoulaye Ba wrote:> The primary use case for this hook is to allow extensions to account > for additional storage mechanisms that are not covered by the > default PostgreSQL relation size calculations. For instance, in our > project, we are working with an external indexing system (Tantivy) > that maintains additional data structures outside the standard > PostgreSQL storage. This hook allows us to include the size of these > additional structures in the total relation size calculations. > > While I understand your suggestion about custom index AMs, the > intent behind this hook is broader. It is not limited to custom > index types but can also be used for other forms of external storage > that need to be accounted for in relation size calculations. This is > why a generic callback hook was chosen over extending the index AM > interface. > > However, if there is a consensus that such a hook would be better > suited within the index AM interface for cases involving custom > index storage, I'm open to discussing this further and exploring how > it could be integrated more tightly with the existing PostgreSQL AM > framework. Yeah, I strongly suspected it was ParadeDB. :) I am only one developer but I really do not like solving this with a hook, instead I think the proper solution is to integrate this properly with custom AMs and storage managers. I think we should do it properly or not at all. Andreas