Re: add timing information to pg_upgrade

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: add timing information to pg_upgrade
Дата
Msg-id 20230728173814.GA3765390@nathanxps13
обсуждение исходный текст
Ответ на Re: add timing information to pg_upgrade  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: add timing information to pg_upgrade  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Fri, Jul 28, 2023 at 01:10:14PM +0530, Bharath Rupireddy wrote:
> How about using INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT and
> INSTR_TIME_GET_MILLISEC macros instead of gettimeofday and explicit
> calculations?

That seems like a good idea.

> +    report_status(PG_REPORT, "ok (took %ld ms)", elapsed_ms);
> 
> I think it's okay to just leave it with "ok  \t %ld ms", elapsed_ms);
> without "took". FWIW, pg_regress does that way, see below:

I'm okay with simply adding the time.  However, I wonder if we want to
switch to seconds, minutes, hours, etc. if the step takes longer.  This
would add a bit of complexity, but it would improve human readability.
Alternatively, we could keep the code simple and machine readable by always
using milliseconds.

> Just curious, out of all the reported pg_upgrade prep_status()-es,
> which ones are taking more time?

I haven't done any testing on meaningful workloads yet, but the following
show up on an empty cluster: "creating dump of database schemas",
"analyzing all rows in the new cluster", "setting next transaction ID and
epoch for new cluster", "restoring datbase schemas in the new cluster", and
"sync data directory to disk".  I imagine the dump, restore, and
file-copying steps will stand out once you start adding data.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: New PostgreSQL Contributors
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: New PostgreSQL Contributors