Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZXcc-0017YN-0F for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 17:30:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZXca-001yEg-31 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 17:30:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZXca-001yEY-1z for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 17:30:44 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZXcY-00000000lps-1X3E for pgsql-hackers@postgresql.org; Tue, 16 Jun 2026 17:30:44 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-8db4b249ebfso3388906d6.2 for ; Tue, 16 Jun 2026 10:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781631038; cv=none; d=google.com; s=arc-20240605; b=ctj9cIv7h+IjEIt616damUsFWNN01cyHjti6/05q/drKwdlCI7wn1ttR5NNumfl3tT otK5nzbC3+Lzp0imPlsIQ++1LmzeDJq0uGSqFuZNssiaS3TzSW2CIivh++gRxkiiUpgZ ctnAWiIc7s7gP7Q1dLEgLTYyhgZXfOJKDHG6WIWF9J+/JPLxBh2tdNI8/iTk6qk0XGKz Xg1SxeHk8bWxf+3AOIjLmkcLvP/hHOg9guUbamTv0x4gqbvYq1FZ3QymHRDSiZO0zFUG ZHPNlU4CepuaJce3yqP/xc1sAGRSZaGHcoqb92B4oIE/56PDZINmh8jzTUgDchroilWK 0N2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OnmoRhgVVOUNd8JL1bFXL4XSCB7t6N5sFIpBe/LPg1Y=; fh=axPrirO4dOnClfJgCFS6K3yHzb+gerDpfmQ71j3HdgI=; b=iOKk5Zd//GMtTx11Z87uCcEqc9UzYcn2PzOadq7GiTR0QuXzVw4amsCYFGImuPyyQi gWxqGiIhvI2cgz9qAvn5oBcwz1dnedqRrxVn8h/0jpui1pjTE1vVkR9j7t8x9HqIhnRE OCVlySDAkmB/EtAMz/J5BBeimMuzEbCvITs8el5nyUK6MSB4w1Rn7LEtw25aboAWjdxx ocPBc61aclqw/TcgSfzp6VDBxhDONv2KIJegb75TIOYQ0idVc+PYnDkV2lpKIyx3IW4D 6zo4e6XbH0Uta/1ehOUl1uXIzEDnK4U7L5k9e6RtWfTtrj3rZEtllsdymXanNexQZJMT roWw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781631038; x=1782235838; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OnmoRhgVVOUNd8JL1bFXL4XSCB7t6N5sFIpBe/LPg1Y=; b=a3P+xtk+Pr4c1PLLGYMUAEpa1cRTq/yMk34300RPo6/phgvLrD1cjs/h/1SeEykvJc dE5FR/wEpm2Kl3PhPFV3n0j1oI47VXIbpsA9Zq+BIU33TT1UAORmvCB4zkpBvReL3Cwm KiYSejhyp8H4Bxnko1wrSkHgvfeuk+f4raBr4WKR0QYppDf6pZ/VOCqQMhxVaO6N/Twi 1zPusdIoLK/DtCsKwN+2itMhnRHYzCR7UTJqjT5+copu6TKcnZdhkOskJhV+rkaJLchh 9AoxXr9lCdqAEJa3GUR6G8XND5z3z8jo0TH3QZE2VU5yCnoB827PVByRkMXzyn6Q2AXU DIHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781631038; x=1782235838; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OnmoRhgVVOUNd8JL1bFXL4XSCB7t6N5sFIpBe/LPg1Y=; b=jfbrT/CtOgwWuTWQS2ZcqigA4SO+TuNAbYeh4E9oZJv92LWzQFtcdoPy/J+tGJIwBX jPmGyZyq/G/LKUnHb3Sq8dda1AA/ZLmvUp0BM/2LKan6+4kLcnQWVAC5tExiLEYeCaVe S1R9GW7T6fqx0cVYmSAIE0msZviOYl1qKKIXwy8RuQuR53v7uKGrRL67+Kg2wbl5IgEf osYD8JXNx5k2bMJhk3+vsFzGdGoWtvQMksxUA9RthuAWOtHpJIL0QgbIpSvzn+r+idyG zNSfb0EAPReAOSErQnOw1CKtrYtvBUtHDpgjmp5pJ8yKg++cue2aehIDxfWNZ5iOtmu+ Ua6Q== X-Gm-Message-State: AOJu0Yw+RwuytFepQeQK0kX/LxUOxni21qU8gEUC/YQGfvIPQLOjlOKD Q+VJE3ZazNorMknci+95/Wmi9OgR/8iLJ/cXdWNVhgK0hYVhDvslcl1g1sxVJroIMV0EAP0qH1M S3iW+k/2WcEIA+3NgDO5breMLn5ZXPcE= X-Gm-Gg: Acq92OERusqTHo18wO7xVQ/QsiLx/SWeYdKcskSdRHHQ0ejkXusrWqvXKm1MLJieMYx ND4HRirK84d4FNhS0mcxBF3Bh9pN5Fps+K+B52cLjgYMg8Zll4co8JZdlDxni8u9nNvfp+ETHYZ 6BEBpM+tyIH5PANBtYUnasmotw2uPIWrI6mCMfH/5y235kStfyZ/7tuRRqCt8txuqayDMe7ZIsR EbxxUC1rUl4fM8Ftj+floY+IpLdeSD5zu0yFZUxC6vIBqdBUf304RFNp4JHAWecIxAdexf4TGJ7 Rk13DumKnBiV0eWUISeMR4QswLw18DyCqjaV7jajVutnScxbJQxPFBAtpxg7HWlrFVmK1hhttSf ib3LS X-Received: by 2002:ad4:4e62:0:b0:8ae:5fcc:8069 with SMTP id 6a1803df08f44-8db5e14affdmr6736066d6.22.1781631038293; Tue, 16 Jun 2026 10:30:38 -0700 (PDT) MIME-Version: 1.0 References: <86f76aa5-1ab5-4e2e-9b15-405051852a2a@postgrespro.ru> <277ce149-4333-463d-bad6-ccd785606c7f@yandex.ru> <3f9c57bc-dc1f-4ad8-a2e1-5be15ac79264@yandex.ru> <77f1b8bc-b365-4e88-b87b-ced37fabbbf0@yandex.ru> <7a74d6af-85e2-4b48-9133-61309a965954@yandex.ru> <1885f257-46cc-4b90-8d90-41833eb62ea9@gmail.com> <0e84acdc-ba65-44fa-be1f-4d6a86bca2ac@yandex.ru> <8bd78e04-6efa-4fcf-b157-8ac3b92375c8@yandex.ru> <10BE6E39-94D2-4909-ACB8-24E1FA6580EE@yandex-team.ru> <877b2c60-6681-4471-ba72-86153f0b9286@yandex.ru> <69e99101-a308-468f-b895-8057305699bf@yandex.ru> <788e9ff4-3ed7-454c-8863-b40bc3288bc9@yandex.ru> <5bc44024-add6-40fd-a8e6-6c4559e09478@yandex.ru> <9d98562b-fa97-476b-9315-6fa2d736ab6b@yandex.ru> In-Reply-To: From: Alexander Korotkov Date: Tue, 16 Jun 2026 20:30:26 +0300 X-Gm-Features: AVVi8CeTiT1iGDWSgBLTiXEslPUSSHw_kXomT7schWo73bsm254vQnbj_uJWGgo Message-ID: Subject: Re: Vacuum statistics To: Alena Rybakina Cc: pgsql-hackers , Masahiko Sawada , Amit Kapila , Jim Nasby , Bertrand Drouvot , Kirill Reshke , Melanie Plageman , jian he , Sami Imseih , vignesh C , Ilia Evdokimov , Andrey Borodin , Andrei Zubkov , Andrei Lepikhov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Alena! On Tue, Jun 16, 2026 at 6:10=E2=80=AFPM Alena Rybakina wrote: > Attached is a reworked version of the patch set. The main change is that = the > statistics are no longer exposed through a contrib extension; they are no= w > built-in system views - pg_stat_vacuum_tables, pg_stat_vacuum_indexes and > pg_stat_vacuum_database - backed by pg_stat_get_vacuum_*() functions and = stored > in the cumulative statistics system under a dedicated stats kind > (PGSTAT_KIND_VACUUM_RELATION). Collection is controlled by a single > track_vacuum_statistics GUC; the per-relation tracking list, the reset > function and the shared-memory-size helper from the extension version are= gone. > > The series is also split into smaller, self-contained commits - one per m= etric > category (core heap/tuple counters, missed dead tuples/pages, visibility-= map > transitions, the buffer/WAL/timing sampling machinery, per-relation buffe= rs, > timing and the wraparound failsafe, and WAL) - with the documentation and > tests growing inside each commit. > > Other changes: > > index statistics are accumulated across the bulkdelete and cleanup passes= and reported once per index, in both the serial and parallel paths; > index_vacuum_count is no longer exposed; > the regression coverage is now an in-core vacuum_stats test with determin= istic checks and dedicated scenarios for the non-trivial paths (truncation,= freeze, cost delay, WAL full-page images, index page deletion), an isolati= on test for recently_dead/missed_dead tuples, and a xid_wraparound TAP test= for the failsafe counter. Thank you for the updated patchset. Some notes about it. 1) PgStat_CommonCounts.interrupts_count is never incremented. 2) LVRelState.wraparound_failsafe_count can only be incremented once in lazy_check_wraparound_failsafe(). Should we replace it with a bool? 3) Vacuum statistics isn't counted correctly for parallel index vacuum. parallel_vacuum_process_one_index() doesn't call neither extvac_stats_start_idx(), extvac_stats_end_idx(), or extvac_accumulate_idx_repor(). This leads all index vacuum stats to go the heap stats. I also think you need a reliable test cases to cover issues like this. 4) It seems that pgstat_vacuum_db_flush_cb() and pgstat_vacuum_relation_flush_cb() are unused as pgstat_report_vacuum_extstats() reports directly to shmem. What was your intention here? 5) Commit message of 0001 uses stale names rev_all_visible_pages/rev_all_frozen_pages counters for visible_page_marks_cleared` / `frozen_page_marks_cleared. ------ Regards, Alexander Korotkov Supabase