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.96) (envelope-from ) id 1wCsfK-002ORu-1z for pgsql-admin@arkaria.postgresql.org; Wed, 15 Apr 2026 05:19:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCsfI-00EYLD-21 for pgsql-admin@arkaria.postgresql.org; Wed, 15 Apr 2026 05:19:53 +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.96) (envelope-from ) id 1wCsfI-00EYL5-0v for pgsql-admin@lists.postgresql.org; Wed, 15 Apr 2026 05:19:53 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wCsfB-000000019r2-1Ehi for pgsql-admin@lists.postgresql.org; Wed, 15 Apr 2026 05:19:51 +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 63F5Jfmb1931206; Wed, 15 Apr 2026 01:19:41 -0400 From: Tom Lane To: OMPRAKASH SAHU cc: Ron Johnson , Pgsql-admin Subject: =?UTF-8?B?UmU6IHBlcmZvcm1hbmNlwqBpc3N1ZcKgd2l0aMKgYcKgUEwvcGdT?= =?UTF-8?B?UUzCoGZ1bmN0aW9uwqA=?= In-reply-to: References: Comments: In-reply-to OMPRAKASH SAHU message dated "Wed, 15 Apr 2026 08:29:46 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1931204.1776230381.1@sss.pgh.pa.us> Date: Wed, 15 Apr 2026 01:19:41 -0400 Message-ID: <1931205.1776230381@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk OMPRAKASH SAHU writes: > I am using a temp table name 5 to 6 times, by storing the data temporarily > and handing over to other temp and then drop & create temp_table with same > name to store next temporary data, That's definitely an anti-pattern. Can you TRUNCATE the temp table instead of drop-n-recreate? > Seeing the query plan just by running explain is hectic in case of > function having more than 4k lines of code, can you please help me if > there is any tool to check the whole execution plan for a function just > like we get for a select query. There's no "whole execution plan" for a function, only for individual queries within it. You might find auto_explain (with log_nested_statements turned on) to be useful to capture those query plans. regards, tom lane