Re: Track the amount of time waiting due to cost_delay

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Track the amount of time waiting due to cost_delay
Date: 2024-12-11 16:40:04
Message-ID: Z1nAZDN_qrh3cq8E@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 11, 2024 at 07:00:50AM +0000, Bertrand Drouvot wrote:
> On Tue, Dec 10, 2024 at 11:55:41AM -0600, Nathan Bossart wrote:
>> I wonder if it makes sense to provide this value as an interval instead of
>> the number of milliseconds to make it more human-readable.
>
> Yeah we could do so, but that would mean:
>
> 1. Write a dedicated "pg_stat_get_progress_info()" function for VACUUM. Indeed,
> the current pg_stat_get_progress_info() is shared across multiple "commands" and
> then we wouldn't be able to change it's output types in pg_proc.dat.
>
> Or
>
> 2. Make use of make_interval() in the pg_stat_progress_vacuum view creation.
>
> I don't like 1. that much and given that that would be as simple as:
>
> "
> select make_interval(secs => time_delayed / 1000) from pg_stat_progress_vacuum;
> "
>
> for an end user to display an interval, I'm not sure we should provide an interval
> by default.
>
> That said, I agree that milliseconds is not really human-readable and
> does not provide that much added value (except flexibility), so I'd vote for 2.
> if you feel we should provide an interval by default.

That's roughly what I had in mind.

> Yeah I like it, thanks! Now, I'm wondering if we should not also add something
> like this:
>
> "
> Since multiple workers can sleep simultaneously, the total sleep time can exceed
> the actual duration of the vacuum operation.
> "
>
> As that could be surprising to see this behavior in action.

I'd vote for leaving that out, if for no other reason than it can be
deduced from the rest of the description.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-12-11 16:54:27 Re: CRC32C Parallel Computation Optimization on ARM
Previous Message Robert Haas 2024-12-11 16:34:31 Re: Proposal to add a new URL data type.