{"Entry":{"collection":"waitevent","key":"timeout/VacuumTruncate","name":"VacuumTruncate","aliases":["VacuumTruncate"],"metadata":{"aliases":["VacuumTruncate"],"changed_in":[],"changes":[{"from":"14","moved":null,"renamed":null,"reworded":null,"status":"added","to":"15"}],"content_hash":"d4a1eb005778f4bdfe69dbe4ca30ae82a12c6b3d83eae90638db4b0a12bf125d","dossier":{"actions":{"en":["Identify the GUC or function that owns the timer.","Compare productive work with time spent delayed.","Adjust the policy only after checking the CPU, I/O, and durability pressure it was designed to control."],"zh":["确认拥有该计时器的 GUC 或函数。","比较有效工作量与延迟时间。","先检查它原本要控制的 CPU、I/O 与持久性压力，再调整策略。"]},"diagnostic_sql":[{"id":"sessions","min_version":"13","sql":"SELECT pid, backend_type, usename, datname, application_name,\n       state, now() - query_start AS query_age,\n       now() - xact_start AS xact_age,\n       wait_event_type, wait_event,\n       pg_blocking_pids(pid) AS blocking_pids,\n       left(query, 160) AS query\nFROM pg_stat_activity\nWHERE wait_event_type = 'Timeout'\n  AND wait_event = 'VacuumTruncate'\nORDER BY query_age DESC NULLS LAST;","title":"Sessions waiting on Timeout/VacuumTruncate","title_zh":"正在等待 Timeout/VacuumTruncate 的会话"},{"id":"cohort","min_version":"13","sql":"SELECT wait_event, count(*) AS waiting_sessions,\n       count(*) FILTER (WHERE state = 'active') AS active_waiters,\n       max(now() - query_start) AS oldest_query\nFROM pg_stat_activity\nWHERE wait_event_type = 'Timeout'\nGROUP BY wait_event\nORDER BY waiting_sessions DESC, wait_event;","title":"Current Timeout cohort","title_zh":"当前 Timeout 等待分布"},{"id":"lock_objects","min_version":"13","sql":"SELECT a.pid, l.locktype, l.mode, l.granted, l.fastpath,\n       d.datname, n.nspname, c.relname,\n       l.page, l.tuple, l.virtualxid, l.transactionid,\n       l.classid, l.objid, l.objsubid\nFROM pg_stat_activity AS a\nLEFT JOIN pg_locks AS l ON l.pid = a.pid\nLEFT JOIN pg_database AS d ON d.oid = l.database\nLEFT JOIN pg_class AS c\n  ON c.oid = l.relation\n AND l.database = (\n       SELECT oid FROM pg_database WHERE datname = current_database()\n     )\nLEFT JOIN pg_namespace AS n ON n.oid = c.relnamespace\nWHERE a.wait_event_type = 'Timeout'\n  AND a.wait_event = 'VacuumTruncate'\nORDER BY a.pid, l.granted, l.locktype, l.mode;","title":"Lock and relation context for these sessions","title_zh":"这些会话的锁与关系上下文"}],"emission":{"status":"active","verified_release":"18.6"},"gucs":["autovacuum_naptime"],"incident_pattern":{"en":"","zh":""},"mechanism":{"en":"`WAIT_EVENT_VACUUM_TRUNCATE` at `src/backend/access/heap/vacuumlazy.c:3280` is the grep-verified reporting path. The public identity/resource is mapped at `src/backend/utils/activity/wait_event_names.txt:183`. The instrumented operation is: Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed. The VacuumTruncate path deliberately waits on a timer, retry interval, throttle, or safety backoff. The latch timeout expires before work is reconsidered.","zh":"`WAIT_EVENT_VACUUM_TRUNCATE` 位于 `src/backend/access/heap/vacuumlazy.c:3280`，是经 grep 核验的报告路径。公共身份/资源映射位于 `src/backend/utils/activity/wait_event_names.txt:183`。探针覆盖的操作是：等待获取独占锁，以截去正在执行 vacuum 的表末尾所有空页。VacuumTruncate 路径有意等待计时器、重试间隔、节流或安全退避；latch 超时后才重新评估工作。"},"metrics":["waiting_sessions","wait_event_share","oldest_transaction_age"],"normal":{"en":"The wait is normal when the configured policy is intentional and useful work advances at the expected rate.","zh":"当配置策略是有意的，而且有效工作按预期速率推进时，这项等待正常。"},"official_descriptions":{"15":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed.","16":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed.","17":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed","18":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed"},"record_kind":"event","source_locations":[{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"WAIT_EVENT_VACUUM_TRUNCATE);","grep_pattern":"WAIT_EVENT_VACUUM_TRUNCATE","grep_verified":true,"kind":"trigger","line":3280,"major":18,"path":"src/backend/access/heap/vacuumlazy.c","status":"live_trigger","symbol":"WAIT_EVENT_VACUUM_TRUNCATE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/access/heap/vacuumlazy.c#L3280","version":"18.6"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"VACUUM_TRUNCATE\t\"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed.\"","grep_pattern":"VACUUM_TRUNCATE","grep_verified":true,"kind":"catalog_definition","line":183,"major":18,"path":"src/backend/utils/activity/wait_event_names.txt","status":"live_trigger","symbol":"VACUUM_TRUNCATE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/utils/activity/wait_event_names.txt#L183","version":"18.6"}],"source_status":"live_trigger","trouble":{"en":"Investigate when the policy causes missed maintenance, recovery, backup, or latency objectives, or when a spin delay persists.","zh":"策略导致维护、恢复、备份或延迟目标无法达成，或者 spin delay 持续时，应当调查。"}},"first_version":"15","has_dossier":true,"imported_at":"2026-09-27T17:57:33.115087+08:00","key":"timeout/vacuumtruncate","last_version":"20","name":"VacuumTruncate","position":301,"present_in":["15","16","17","18","19","20"],"slug":"vacuum-truncate","source_rev":"english-manuals:a18974e1e9d2eb6008edad72e3176c35e849b27e65d92276c3dec79a98628fae","summary":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed.","summary_zh":"","type":"Timeout","type_slug":"timeout","type_variants":["Timeout"]}},"Definition":{"Collection":"waitevent","Key":"timeout/VacuumTruncate","SourceDatabase":"center","Version":"18","SourceTable":"waitevent","SourceKey":"timeout/vacuumtruncate","SourceRevision":"english-manuals:a18974e1e9d2eb6008edad72e3176c35e849b27e65d92276c3dec79a98628fae","Facts":{"description":"Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed.","description_zh":"","doc":{"anchor":"WAIT-EVENT-TIMEOUT-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"lang":"en","name":"VacuumTruncate","source":"english-manual","type":"Timeout","zh_from":""},"ManualEvidence":{"doc":{"anchor":"WAIT-EVENT-TIMEOUT-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"waitevent","Key":"timeout/VacuumTruncate","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"VacuumTruncate","Summary":"等待获取独占锁以截断被清理的表末尾的空页面。","BodyHTML":"\u003cp\u003e等待获取独占锁以截断被清理的表末尾的空页面。\u003c/p\u003e","SourceRevision":"2026-08-31@34d13c8","ContentHash":"012eaf74b8247c698eb458e2381ef9ae040a6ed71db1ced319229b43b886b67f","Payload":{"description_zh":"等待获取独占锁以截断被清理的表末尾的空页面。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
