From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: shashidhar Reddy <shashidharreddy001@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Finding execution plan
Date: Fri, 3 Nov 2023 10:56:22 -0700
Message-ID: <5e5bc083-0bf6-41f0-baad-0636a02b5ab9@aklaver.com> (raw)
In-Reply-To: <ZUUz3D7luiCxeqij@momjian.us>
References: <CAH=zU4vaNYtF+KQ_9PJVxHDDM+73TPY-uLT6Kn6DyR8M6YsB0w@mail.gmail.com>
<42ac2198-ecb3-4a7e-a40d-d5f231c99e10@aklaver.com>
<ZUUz3D7luiCxeqij@momjian.us>
On 11/3/23 10:54 AM, Bruce Momjian wrote:
> On Fri, Nov 3, 2023 at 10:44:12AM -0700, Adrian Klaver wrote:
>> 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."
> Since he asked about execution plans, I was thinking auto_explain:
>
> https://www.postgresql.org/docs/current/auto-explain.html
Yeah, that would be the better option.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, bruce@momjian.us, shashidharreddy001@gmail.com
Subject: Re: Finding execution plan
In-Reply-To: <5e5bc083-0bf6-41f0-baad-0636a02b5ab9@aklaver.com>
References: <CAH=zU4vaNYtF+KQ_9PJVxHDDM+73TPY-uLT6Kn6DyR8M6YsB0w@mail.gmail.com> <42ac2198-ecb3-4a7e-a40d-d5f231c99e10@aklaver.com> <ZUUz3D7luiCxeqij@momjian.us> <5e5bc083-0bf6-41f0-baad-0636a02b5ab9@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox