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.94.2) (envelope-from ) id 1uFfo2-007Kd7-MK for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 21:07:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uFfn1-00GaXm-Ss for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 21:06:51 +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.94.2) (envelope-from ) id 1uFfn1-00GaXd-GV for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 21:06:51 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uFfmw-0025M8-2W for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 21:06:51 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6f54079e54bso12904306d6.1 for ; Thu, 15 May 2025 14:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747343205; x=1747948005; darn=lists.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=H9r+2mVeftrikQbhptJ3goATVYRD/W7JShQx92dJV/Y=; b=SFtkBXH45qMkgD0yRbNqbhcLeZnnxKdyd12fQyOIllILJtPhjXLQP/x/tV4Mv0IlxG fTyrgS8EBffcOvPq2wntzfRu6bu15Xncqm6IZNogvZaK4wWvVCGNv7I6oYh/LPbNB3oN IKSU48zCDz3q0B5JL09NkLltVC3y8jniSuWvmc+2enbHv1QljQcjou8yI4h6f2NJYPFT zip7dvBymR8l46xFbn5hO5e1hTZM5CYU6CqRHRusBAJitUR4PIaHvRkWjQQhb7Lg/ci2 BDPfCWPruPzDrEhAA3RtuhePfdTZG5kbcVoAZfuKP5Hps35a02Br2joZg4kH/cGQjqiC 8Riw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747343205; x=1747948005; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H9r+2mVeftrikQbhptJ3goATVYRD/W7JShQx92dJV/Y=; b=QpxwKJQ5Gc+RlVgrErOqhqWe3eyDv/BGtnfscC6YzkJx9tkUXI2SfZr3D9ImMgxMPJ SR6a55wzGV2npIuI+qnRaiFw9RsN2AuAQWvZ4dUL1sr/tBXuuGOOucPyIhJ9aJgNFoRm fi4ADkgoWkMgokrK1OND+VaaitOrXPOfvPdSfXCgdHD/MG5sDKQg/+L6whjVYVQGivx+ 5uCYODYm4DJYEONXBrDyVj/grutbf14j+JFa2t0sC3nzaXxMDXRN0KWCVMS6etJHQ7l8 cDVHhnMNfvX+9HntzWXN6Tzh1KVto4qq76/cee00sB8pdyBPFvANNkHshkj2ysMRg51S DxtA== X-Forwarded-Encrypted: i=1; AJvYcCVVF3CoiYdAKTQs5LuGGfSON3PlXTQ76rAONWmwC8KD61da1ffdZ9f42qYxYokzzNAYnPL881XzsB6sB2nX@lists.postgresql.org X-Gm-Message-State: AOJu0YwvHP+unUEUGiOnf45Mrq27k/zuM9Nzg1nfTdnpUENz0X1aPw9V YCa6+fG2tp3xEh+90YFu+C376TCxgOjtZ0DVVNI7pl1Blvsvmmw2rs54v0qgQkttCMpXsvMsYzj oCqF6lVj12CtcVt19QNouLeAdUYXJ/K4= X-Gm-Gg: ASbGncvROgbUjpgRRuMMYOBicuUNTqeXwtlTvgW0tD9WuXy38XneN8gnsDTartnAHXl TUUYeUYv6yNEBm63TUz6CU9ckkvZ1oyqXsWhNzJuCHGts9rgms8HVn4TEd0vAgawNqpXKT88Ar/ XuO7CR3trZ/XSaNwmTsPjmNrkemjArfdGrBeNuO5AH7zPMUuwquJaiN5hpynnImnFMwQ== X-Google-Smtp-Source: AGHT+IGWUYNoWMa+/mu6ef9ynIOaAfA9ABftc0wTEF15dcFZJu/wB9rbVxFWqux4hRe77CsRlzDXqwQoxgoQauxkR4U= X-Received: by 2002:a05:622a:a13:b0:494:a208:7e3b with SMTP id d75a77b69052e-494ae372dcemr14156071cf.24.1747343205190; Thu, 15 May 2025 14:06:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matheus Alcantara Date: Thu, 15 May 2025 18:06:19 -0300 X-Gm-Features: AX0GCFt-R3Lhg-9Bh0FWK6gJ82t-fgcdIvk6PmD0cj0ZHzZ3t8gshMoFdYeh0gI Message-ID: Subject: Re: POC: Parallel processing of indexes in autovacuum To: Daniil Davydov <3danissimo@gmail.com> Cc: Sami Imseih , Masahiko Sawada , Maxim Orlov , Postgres hackers 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, On 09/05/25 15:33, Daniil Davydov wrote: > Hi, > As I promised - meet parallel index autovacuum with bgworkers > (Parallel-index-autovacuum-with-bgworkers.patch). This is pretty > simple implementation : > 1) Added new table option `parallel_idx_autovac_enabled` that must be > set to `true` if user wants autovacuum to process table in parallel. > 2) Added new GUC variable `autovacuum_reserved_workers_num`. This is > number of parallel workers from bgworkers pool that can be used only > by autovacuum workers. The `autovacuum_reserved_workers_num` parameter > actually reserves a requested part of the processes, the total number > of which is equal to `max_worker_processes`. > 3) When an autovacuum worker decides to process some table in > parallel, it just sets `VacuumParams->nworkers` to appropriate value > (> 0) and then the code is executed as if it were a regular VACUUM > PARALLEL. > 4) I kept test/modules/autovacuum as sandbox where you can play with > parallel index autovacuum a bit. > > What do you think about this implementation? > I've reviewed the v1-0001 patch, the build on MacOS using meson+ninja is failing: =E2=9D=AF=E2=9D=AF=E2=9D=AF ninja -C build install ninja: Entering directory `build' [1/126] Compiling C object src/backend/postgres_lib.a.p/utils_misc_guc_tables.c.o FAILED: src/backend/postgres_lib.a.p/utils_misc_guc_tables.c.o ../src/backend/utils/misc/guc_tables.c:3613:4: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion] 3613 | NULL, | ^~~~ It seems that the "autovacuum_reserved_workers_num" declaration on guc_tables.c has an extra gettext_noop() call? One other point is that as you've added TAP tests for the autovacuum I think you also need to create a meson.build file as you already create the Makefile. You also need to update the src/test/modules/meson.build and src/test/modules/Makefile to include the new test/modules/autovacuum path. --=20 Matheus Alcantara