Re: Track the amount of time waiting due to cost_delay
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Masahiro Ikeda <ikedamsh@oss.nttdata.com>, "Imseih (AWS), Sami" <simseih@amazon.com>, Masahiko Sawada <sawada.mshk@gmail.com>, pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Date: 2024-12-12T16:15:18Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add delay time to VACUUM/ANALYZE (VERBOSE) and autovacuum logs.
- 7720082ae532 18.0 landed
-
Add cost-based vacuum delay time to progress views.
- bb8dff9995f2 18.0 landed
-
Add is_analyze parameter to vacuum_delay_point().
- e5b0b0ce1509 18.0 landed
-
Refresh cost-based delay params more frequently in autovacuum
- 7d71d3dd080b 16.0 cited
On Thu, Dec 12, 2024 at 04:36:21AM +0000, Bertrand Drouvot wrote:
> --- a/src/backend/catalog/system_views.sql
> +++ b/src/backend/catalog/system_views.sql
> @@ -1222,7 +1222,8 @@ CREATE VIEW pg_stat_progress_vacuum AS
> S.param4 AS heap_blks_vacuumed, S.param5 AS index_vacuum_count,
> S.param6 AS max_dead_tuple_bytes, S.param7 AS dead_tuple_bytes,
> S.param8 AS num_dead_item_ids, S.param9 AS indexes_total,
> - S.param10 AS indexes_processed
> + S.param10 AS indexes_processed,
> + make_interval(secs => S.param11 / 1000) AS total_delay
> FROM pg_stat_get_progress_info('VACUUM') AS S
> LEFT JOIN pg_database D ON S.datid = D.oid;
I think we need to cast one of the operands to "double precision" to avoid
chopping off the fractional part of the result of the division, which seems
important for this case since we are dealing with lots of small sleeps.
Otherwise, at a glance, I think this one is just about ready for commit.
--
nathan