On Mon, Oct 19, 2026 at 12:17 PM Brajendra Pratap Singh <
[email protected]> wrote:

> Hi All,
>
> We need to monitor a function which is running since long to understand at
> which step it is currently running and taking long time to debug the
> function.
>
> Please suggest and let me know if any further information is required
>

I had to spin up a full-sized test database, and add lots of RAISE NOTICE
statements showing the timestamp and what data it was working on at that
moment.  The sad part was that it ran fast when run once, but was slow when
called more than five times.  "set plan_cache_mode = force_custom_plan;"
solved *my* problem.

Of course, your problem is certainly different.  Decomposing it, running
EXPLAIN, looking for sequential scans (including in FK references) is the
way.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

Reply via email to