Re: Should we add timing output to pg_upgrade?

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Should we add timing output to pg_upgrade?
Date: 2026-12-01 15:09:25
Message-ID: aw7jJb8gBTXo7GVi@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rajesh Kumar Thandapani 2026-12-01 15:24:13 Add aborted_txns and aborted_bytes to pg_stat_replication_slots
Previous Message Nazir Bilal Yavuz 2026-12-01 14:43:12 Re: Should we add timing output to pg_upgrade?