On Tue, Dec 01, 2026 at 02:56:57PM +1300, David Rowley wrote:
> I've been doing some work on making pg_upgrade go faster, and I found
> it annoying that we don't include the timing output for each phase. I
> think we should have this as seeing a high number there is more likely
> going to lead to someone investigating, or if we receive pg_upgrade
> output with "this is too slow" type complaints, it'll be easier to get
> to the bottom of why.

+1

> I prompted an LLM to write a patch for this, coaxing it into using
> this time format. I left the actual implementation up to it. It went
> with a global variable to store the start time. I think that's likely
> a better option than having the prep_status functions return the start
> time, as that would require a much more invasive patch. Having an
> extra global in pg_upgrade seems fine to me. I'd more strongly be
> considering alternative ways for backend code.

Your LLM may have been inspired by my patches from 2023:

    https://postgr.es/m/flat/20230727235134.GA3658499%40nathanxps13

> Does it look ok? Or better ideas for time formats? Or objections?

One drawback of this approach is that not every lengthy task has its own
status line.  I vaguely recall that certain things get added to lines that
have no obvious connection.  It might be worth adding more progress output
to cover those.  I'll see if I can find what I'm remembering...

-- 
nathan


Reply via email to