Skip to content

Commit cedffbd

Browse files
committed
Report wait event for cost-based vacuum delay.
Author: Justin Pryzby Discussion: https://postgr.es/m/20200321040750.GD13662@telsasoft.com
1 parent 496ee64 commit cedffbd

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

doc/src/sgml/monitoring.sgml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
15151515
(<filename>pg_wal</filename>, archive or stream) before trying
15161516
again to retrieve WAL data, at recovery.
15171517
</entry>
1518+
<entry><literal>VacuumDelay</literal></entry>
1519+
<entry>Waiting in a cost-based vacuum delay point.</entry>
15181520
</row>
15191521
<row>
15201522
<entry morerows="68"><literal>IO</literal></entry>

src/backend/commands/vacuum.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,9 @@ vacuum_delay_point(void)
20192019
if (msec > VacuumCostDelay * 4)
20202020
msec = VacuumCostDelay * 4;
20212021

2022+
pgstat_report_wait_start(WAIT_EVENT_VACUUM_DELAY);
20222023
pg_usleep((long) (msec * 1000));
2024+
pgstat_report_wait_end();
20232025

20242026
VacuumCostBalance = 0;
20252027

src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,6 +3830,9 @@ pgstat_get_wait_timeout(WaitEventTimeout w)
38303830
case WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL:
38313831
event_name = "RecoveryRetrieveRetryInterval";
38323832
break;
3833+
case WAIT_EVENT_VACUUM_DELAY:
3834+
event_name = "VacuumDelay";
3835+
break;
38333836
/* no default case, so that compiler will warn */
38343837
}
38353838

src/include/pgstat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ typedef enum
850850
WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT,
851851
WAIT_EVENT_PG_SLEEP,
852852
WAIT_EVENT_RECOVERY_APPLY_DELAY,
853-
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL
853+
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL,
854+
WAIT_EVENT_VACUUM_DELAY
854855
} WaitEventTimeout;
855856

856857
/* ----------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy