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 1wJpyP-000LSG-0u for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 09:52:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJpyO-006ZjV-08 for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 09:52:20 +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 1wJpyN-006ZjL-26 for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2026 09:52:19 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wJpyK-00000000QfB-2XDZ for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2026 09:52:18 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso48441325e9.1 for ; Mon, 04 May 2026 02:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1777888335; x=1778493135; darn=lists.postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1d+ZRsRv/6ICPyboATN291qDgsPidff8ROZrwtwsIKQ=; b=rjb1g32i2HuVncTdFH1/HwGO/UZi6zpkq2elf5rN6taDGv1U4kb9JGSAXGM1rO6JYq 1QjL1cRvyGZfDMJ+G8KkHO8NHrA8G/tE8zwZdRkXR/mN/c7WGr7OcAOgcPjUygY4grkK GxrHNfk7CVmpCUyeQhlvE20j+A1sXhssewY13iQ/fg/VpaNFfd08qtix8MhTLaOT2U3W 0rVsl+zgEQjGeUt4CQUNQO6vDjLNZdXFWn3UL6oYTU6xOU0y//OwbprbIzy1TFKrV+R4 Wb9hgP3d9/FBxEm6oaaaJGT2lXhVVPYu6hUK47Xx3pUDgSO1o9ea2yW3q8C9gZu+I/b8 f9UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777888335; x=1778493135; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=1d+ZRsRv/6ICPyboATN291qDgsPidff8ROZrwtwsIKQ=; b=iDtFIH0brS6s2Eefbc5JqCOHsOabPeGk1wqg2urSkbTSwJe/Yp20cVbqTSr/3b5kHt lXsASSYNbtWiKqktFEcTN7f28LB3BYXlXeLlE+2J6J5XTUfiFKFZQ+XcSublFvI9xZwV Y1QyTLSe+kHLXaJqiWMBURFOBAXHUaQ6R6N7q7if1myBcQoEg1dXKPg7GVAcED4KJNkz ovaAK8Mw5yfj0g2z5pCgYjgVH2GDkgUuL0gvoWmPG6Hz+zPeo4tCI+I2sD6KL9D7eeBW M/5Dyuq2E4yRY9ULxJR4STo0A4GcxtFD0S0G35Shfj0dpB291okhSfLwMXZhkFu1Z2Ww hdZg== X-Gm-Message-State: AOJu0YzOvuR/6jocc+RGlQGQpxmis13DnFmkV4jknOveiWuGd9+KJrnU e3nom3NmKQoDbKhj9R8BLXEtxMYMZXbwlBoNZq1KU2mbBUNs8gcGuz68xYfIco6UAvXemlMDadV pLCbl X-Gm-Gg: AeBDievgiTVd1WyXyIbSLMCEc4SqKo1CsVZpVTJzanRcbIqB21HMn7JmD7c1M+M7Ami x3b0g6hv5xrqyWz8WLCZ1laLiWi/qV/jNzCeUrm8Dwfaf4nTUx2yXyuISXDdQ8iKOvu7dVB9oGS R3SWijaWa38a+XKe/QyHjhH3IxYb0gn3hsdkQRAMS7hbFfCP8dICHkBkwVaxopO1/0dbXeJ5pkk hFbEo/k0bOL84hZxO1SHweznbcflVAJvpNol5JhA6gQ/KW6neCDZENA7OJiNJU8UmNjjGdJ9BTR dOCqm95M4M1lMjw9Sn5CtcZgW5vfkfsSulVmF4N0GqY5K6M/A15yvh46T4ayN0hknYBm4xzD5/9 l/lKXKZZ/1CeyzmCgGd5P8s4uSz1ASlvdTSscxSgXoRJFg6R4lSWCrSVOzU61Lz2lPUVFo6bNSs gW2g2uwbFzzKE6LcqZYY1UfBMJqWCSXP3iQt3l2eKGRTESFFQ= X-Received: by 2002:a05:600c:e41a:b0:48a:592c:e642 with SMTP id 5b1f17b1804b1-48a9865f799mr119567275e9.18.1777888335054; Mon, 04 May 2026 02:52:15 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44a8f237368sm23639477f8f.14.2026.05.04.02.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 02:52:14 -0700 (PDT) From: Antonin Houska To: Bharath Rupireddy cc: PostgreSQL Hackers Subject: Re: Report index currently being vacuumed in pg_stat_progress_vacuum In-reply-to: References: Comments: In-reply-to Bharath Rupireddy message dated "Sun, 03 May 2026 19:00:00 -0700." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Mon, 04 May 2026 11:52:13 +0200 Message-ID: <30939.1777888333@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Bharath Rupireddy wrote: > When VACUUM is in the "vacuuming indexes" or "cleaning up indexes" phase, there is currently no easy way to tell which specific index is > being processed. The progress report view shows indexes_total and indexes_processed counters, but not which index is actively being worked > on. > > This makes it difficult to debug slow or stuck autovacuum workers on tables with multiple indexes of different types (btree, GIN, GiST, BRIN, > HNSW, etc.), since one cannot determine which index type or which specific index is causing the delay. > > Please find the attached patch adds a new column current_index_relid to pg_stat_progress_vacuum that reports the OID of the index > currently being vacuumed or cleaned up. The column is reported for both the "vacuuming indexes" phase and the "cleaning up indexes" > phase. > > When indexes are being vacuumed in parallel, each parallel worker emits its own row in pg_stat_progress_vacuum with current_index_relid > set to the index it is currently processing, and leader_pid pointing to the leader process. > > Appreciate any feedback. Thank you! This problem seems to be similar to what I noticed when workign on the REPACK command: progress reporting of index build needs to be disabled if the build is part of REPACK, otherwise the index build can overwrite the counters of REPACK (whether the overwriting actually happens or not is another question). The solution I suggest is to allow progress tracking of a "sub-command" - see the attached patch. Wouldn't that also resolve your problem? (My plan is to incorporate this in the series of REPACK enhancements soon.) -- Antonin Houska Web: https://www.cybertec-postgresql.com --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=nocfbot.Allow-progress-tracking-of-sub-commands.patch