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 1sR4aa-00D9Df-BE for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 06:44:36 +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 1sR4aY-00DS1V-Ou for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 06:44:34 +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 1sR4aY-00DS1N-5K for pgsql-hackers@lists.postgresql.org; Tue, 09 Jul 2024 06:44:34 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sR4aQ-0019wR-Pg for pgsql-hackers@postgresql.org; Tue, 09 Jul 2024 06:44:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=frpsdr4qhb0SA9uelhW5+78ddVqGBlHQxIhonwnyS6s=; b=E6zPdL9ovbMlg1zLW0TPc2I8+V X0VioM/5n2XpyzH8L65ZTldDQPPfWOWAvV2uLgXPfnzI9XDntrDXMIt26VB8sVj/b1rODxTmzYvQR XZkup0u0+X9+iDhhuYLGztgF8q2usmzOeKm5nd32sw9ZAv49QNr4MHk3+PLN8kr7An8yTSje1xaQR rDqLf/3regSmv2tJB8jG4bYWFdmMRLVExZ4/xHEemb7nFBB1qWIkdZu70OzZGxHBiD7rM+lvhZoK5 N+MYVCr8WLSu5XISL6R6RgUzVbbCySCSZRdMF59twwVzyGE3EwaxTSLddEyb/40+11Qb73HqdiHcC lPIc+wpw==; Received: from [2409:11:4120:300:e3ef:56d2:79b3:6315] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1sR4aK-002RJh-Vr; Tue, 09 Jul 2024 06:44:24 +0000 Date: Tue, 09 Jul 2024 15:44:09 +0900 (JST) Message-Id: <20240709.154409.1091516017393224028.ishii@postgresql.org> To: ashutosh.bapat.oss@gmail.com Cc: dgrowleyml@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN From: Tatsuo Ishii In-Reply-To: References: <20240709.114412.199303920149670049.ishii@postgresql.org> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:e3ef:56d2:79b3:6315 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >> Yes, I think so. I'd keep each as a separate patch so they can be >> considered independently. Doing all of them should hopefully ensure we >> strike the right balance of what code to put in explain.c and what >> code to put in tuplestore.c. > +1 > > + if (es->format != EXPLAIN_FORMAT_TEXT) > + { > + ExplainPropertyText("Storage", storageType, es); > + ExplainPropertyInteger("Maximum Storage", "kB", spaceUsedKB, es); > + } > + else > + { > + ExplainIndentText(es); > + appendStringInfo(es->str, > + "Storage: %s Maximum Storage: " INT64_FORMAT "kB\n", > + storageType, > + spaceUsedKB); > + } > > It will be good to move this code to a function which will be called > by show_*_info functions(). I have already implemented that in this direction in my working in progress patch: /* * Show information regarding storage method and maximum memory/disk space * used. */ static void show_storage_info(Tuplestorestate *tupstore, ExplainState *es) Which can be shared by Material and CTE scan node. I am going to post it after I take care Recursive Union and Table Function Scan node. > We might even convert it into a tuplestore > specific implementation hook after David's work. Best reagards, -- Tatsuo Ishii SRA OSS LLC English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp