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 1rsA7k-005ECl-TQ for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 23:34:33 +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 1rsA7j-00AmzE-8B for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 23:34:31 +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 1rsA7i-00Amz5-V3 for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 23:34:30 +0000 Received: from wfhigh8-smtp.messagingengine.com ([64.147.123.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rsA7c-000RC6-7W for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 23:34:29 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfhigh.west.internal (Postfix) with ESMTP id 748F71800099; Wed, 3 Apr 2024 19:34:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 03 Apr 2024 19:34:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712187261; x=1712273661; bh=gVjR9NgZDZ uuwHMsVW6+/b0PZR5xrUGBZAwOVZPatjA=; b=cOahZwJX3AEoEvWD57fHKnSYcA xyLdkMeYLrKWRtDXS0UgOWp+HnK083BdA8ovexSTyhvw+LL5qqfsZq6YGMCa3ObU Cnf/DoGO+hqVyNbrJ6wewN1yrLuUVRJ4jdVvO1L3/vq1UN3BB+9UbGJEUUb1HoIS osXbfqquAbWN/8cIA5Xu5Ck+teShw8Xr28wMc4UGPB2VW+uQ+pcYNhaxe9hvleTZ lk9pX8nxn8MegN43JB5Hc24NO28gk9OsuiZrXdKXx27v3PgZhqKijrjKJ8xf69mY Zqxz9wmXDMzXS31zYpluN/dBIxWcxE2+zlFAaWmNypluWXAWs7kBWQwbu46g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712187261; x=1712273661; bh=gVjR9NgZDZuuwHMsVW6+/b0PZR5x rUGBZAwOVZPatjA=; b=nnY2w2UQQx0kaOTQAm4M1ID0prp/900y2YqlqSDibxzG DtgrnQvwJkyXStHd3mFQ3sawakeHBqaGZM1LRahLIJNzszXLGr0Rns3ExS+bgIZc 7/M2djOrH8k2Ip27kUJvsxr9XG1tSC6PZncRBLajVY6qaYk/Yo1LC+Es45B7M5Np VIzD3DP+JhYYvaJJziOdzTSBWAqtOEjuv1RUlBAxO0SGDHqunuRbaoWdTfVFt5vP rXWxNDEm8vEFYdDGwKriV+cKW8ilIIKmv01lFvfDWtCO0fDRQLelxWAor28sKEBR p/joATbMDOT5xbW3+vYH3qN6VGj6oa8lrlmHNwQimQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepveetjefgjeevgedukeehieeu ieeuieevueeiudegheevuefggfduueelgeelieetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 19:34:18 -0400 (EDT) Date: Thu, 4 Apr 2024 08:34:04 +0900 From: Michael Paquier To: Melih Mutlu Cc: torikoshia , Andres Freund , Stephen Frost , PostgreSQL Hackers Subject: Re: Parent/child context relation in pg_get_backend_memory_contexts() Message-ID: References: <20231012162309.4wmc2nb5tkt6pzml@awork3.anarazel.de> <2f34c14847fc03752f0bca7d97aeae27@oss.nttdata.com> <18d210bb7010f87cdb0019fa846d45ea@oss.nttdata.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qYN9xxeYIDIFdU8z" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qYN9xxeYIDIFdU8z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 03, 2024 at 04:20:39PM +0300, Melih Mutlu wrote: > Michael Paquier , 14 =C5=9Eub 2024 =C3=87ar, 10:23 t= arihinde > =C5=9Funu yazd=C4=B1: >> I was reading the patch, and using int[] as a representation of the >> path of context IDs up to the top-most parent looks a bit strange to >> me, with the relationship between each parent -> child being >> preserved, visibly, based on the order of the elements in this array >> made of temporary IDs compiled on-the-fly during the function >> execution. Am I the only one finding that a bit strange? Could it be >> better to use a different data type for this path and perhaps switch >> to the names of the contexts involved? >=20 > Do you find having the path column strange all together? Or only using > temporary IDs to generate that column? The reason why I avoid using conte= xt > names is because there can be multiple contexts with the same name. This > makes it difficult to figure out which context, among those with that > particular name, is actually included in the path. I couldn't find any > other information that is unique to each context. I've been re-reading the patch again to remember what this is about, and I'm OK with having this "path" column in the catalog. However, I'm somewhat confused by the choice of having a temporary number that shows up in the catalog representation, because this may not be constant across multiple calls so this still requires a follow-up temporary ID <-> name mapping in any SQL querying this catalog. A second thing is that array does not show the hierarchy of the path; the patch relies on the order of the elements in the output array instead. -- Michael --qYN9xxeYIDIFdU8z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmYN52wACgkQnvQgOdby QH0HmQ/9EYcFyf4pLv+9TjPOhNifyneq0evrdKX+xFwHFGzGGV/InFFv9kzgRBN/ ioP2Gc1l01c+QLX/+zV3EAgOez+3HShjrRYc1tHo8GAIeM3oaYacOroqj50rBOkt 3fI0oKjlK++5voOKYqO9B1zXptK330Fev8awZi6AxQMyCVfsnG/Qjx12gE2OrcBx DjLWy20UoH4f6zDiCdkaQF6ccPpox/xQ+NZhQ52n3tna3+lrULXFgUdq+7D4Ym+2 dMPMOgj6y0hJQjjOx3RFVcpo9m7KH0RdEFLw8yEImKUYgqWGMr6zIOhrIo/DQjx8 csnhU1NlRFHGzd9xwdPNl6mTAFewoimM/5xMexIyawgLCD/yNKdSAOuX7MkiZ493 eKgSZKKkKT8qOcXpo1U4on6c0eVXpaEtLxtrGEVoFBjYix/eMBkxz9jM/V+3ojq8 8IShnKhX1TXJJZIf9FbRe6Km0845JYmCs1307wyDtDFObezLLG9Lvlqnm8wBY4QZ dAw/F+XXpBtgp25DXfGZOiacyRwlDoEfy1iikS6/7RoN4Ll/YgZBraFyS5xlYOwI MYImX78Ca9cebJtGS7FWGrK5kvQ1LEu6TcDrgbBGApQRGo1XtBuo2LjbdNKr6x5N GRAVwk0prz3ffKSHF2NFPXkaE1L2ck8KqcQaZcHpMzCia0pBdrc= =oiCf -----END PGP SIGNATURE----- --qYN9xxeYIDIFdU8z--