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 1qyyDe-00CQ3f-2Q for pgsql-general@arkaria.postgresql.org; Fri, 03 Nov 2023 17:44:30 +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 1qyyDc-0024xY-P8 for pgsql-general@arkaria.postgresql.org; Fri, 03 Nov 2023 17:44:28 +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 1qyyDa-0024xP-UL for pgsql-general@lists.postgresql.org; Fri, 03 Nov 2023 17:44:28 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyyDS-004WsX-FS for pgsql-general@postgresql.org; Fri, 03 Nov 2023 17:44:26 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1E11F5C01EE; Fri, 3 Nov 2023 13:44:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 Nov 2023 13:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1699033456; x=1699119856; bh=R8 k2LtcrsVJzRR33vngAG5brcy0W6DHpPcA0mLwuVkg=; b=K/y7PiiagyCE4WV2PR OyfOGFdeNHVhY6MJQgD3hbMeqrA3kEONYXLSdgRf5w2H0gK6n/QqeSCF2OXPkbbu fnrugxmx5A79bBZqV3HyTu6WgQCz2ylGChuusp+gP8T2sd2Z/Zs8TlH6fPubbWdg 3sBcTNfwgAn1FuRgR3jQf7KrZwYYrmK/oT2fjWw0Acn5P4bjon9EPWsJd/UxTOX8 xFmEFn8meXM/RxY2Ex2xkn8W54ffvhP4CzrqvHDglonm8EHAoN/9hN2CTjevIQKJ UWrSiwtJfeKkhv64A8asFZl0+aTu3zxeox9TLZ1BXlRo7CDCjDb2W8tH1hGLgUbH 9OPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1699033456; x=1699119856; bh=R8k2LtcrsVJzR R33vngAG5brcy0W6DHpPcA0mLwuVkg=; b=XxPzygN5geAekHEfhgqslv9hFVM7/ SnJPxnt8itFAyPJ1jbdmb8ilWkb8tF4YkFYjone4yboKCYBe9qU21aZvlV9QhC80 BMKtYqp/VLSTm5B5px/Mm8xWQjT4mRMj0X++kM2LLiS/RYPsl6AQkCiMqrbICoeU 2U0WX8S40CQnPEByAPiXf45Ju6WOSfE+znSPTGqvomgJp1Gxp6nojZgHBqzf0/HD aQtxIwTBu0VThanNlmgu/vfvVy4IVUbzBGRjGjUAXnn2j8ANGJU/k2X+P3qNvZK2 99ci4onD1ACaPXAiTH35q5xT+3FUEpNBdok52Xpi0rZL3dROD1mBnZWvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtkedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeeluefgjeejieffgeeihfehveelteekffelhfffieej ffejjeeuteeitdeikedugeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Nov 2023 13:44:14 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------gSkIp0mMVIW4FUuRhgN8XLce" Message-ID: <42ac2198-ecb3-4a7e-a40d-d5f231c99e10@aklaver.com> Date: Fri, 3 Nov 2023 10:44:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Finding execution plan To: shashidhar Reddy , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: 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. --------------gSkIp0mMVIW4FUuRhgN8XLce Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/3/23 10:40 AM, shashidhar Reddy wrote: > Hello All, > > I have a Postgresql function scheduled to run on the database, some > tines it is taking too long than usual time, is it possible to get the > execution plan of this function or any other way to troubleshoot You might to take a look at the contrib module: https://www.postgresql.org/docs/current/pgstatstatements.html "The |pg_stat_statements| module provides a means for tracking planning and execution statistics of all SQL statements executed by a server." --------------gSkIp0mMVIW4FUuRhgN8XLce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 11/3/23 10:40 AM, shashidhar Reddy wrote:
Hello All,

I have a Postgresql function scheduled to run on the database, some tines it is taking too long than usual time, is it possible to get the execution plan of this function or any other way to troubleshoot


You might to take a look at the contrib module:


https://www.postgresql.org/docs/current/pgstatstatements.html


"The pg_stat_statements module provides a means for tracking planning and execution statistics of all SQL statements executed by a server."

--------------gSkIp0mMVIW4FUuRhgN8XLce--