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 1vIuKd-002Gk6-1L for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 19:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIuKb-007M5L-0D for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 19:47:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vIuKa-007M5D-2T for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 19:47:08 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIuKU-006b52-1m for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 19:47:07 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-9489dc9845dso2794839f.0 for ; Tue, 11 Nov 2025 11:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762890422; x=1763495222; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ic1UEIT11FkpbZzpaAXD6O9NlN1Mo3Bj9/yvC6rKZck=; b=jsezj9+NaZony8Z5ahlNN/H1RHygsm/M1OEWUNUWncWMzbCqqX7bjhvga32jm2ytFI Ba5XKvFY2xLQhzfGk35feRDTwoqYwkST832F50ccGnQe1a1yB+dxyyXVL4MjBQoa7O7C tdge3VAd4+w3NTPUkFwzf8JKfVPPaWYoJMVnBSge3BC5zH3zrOg7Qh9oti4RRxmGrv44 J1m4SeIWvaE7m6XPWWVmWswaLZw1vd+D/1qlbuIbXYoJKzsscSuFbFJlBOgXIyFkLtsp Cssxr/3K3GeuQP6bwYS0Rm8ftv5FL4nR47zD1lV3WSpnaAJFCIs9T+vZcTR3anLR4Koe w3Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762890422; x=1763495222; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ic1UEIT11FkpbZzpaAXD6O9NlN1Mo3Bj9/yvC6rKZck=; b=D/r2lHEeo/9LgiyamgGTa/ULtBtCQy/sj/yJmqWkmjQpVFJsA+jEthd1WysL8Y4sJw 6rO3d8Yh3LtI9N6rtGZj2oVOsRiS/m3Os198Z9f+4HyKuVP3vs2dcJ1CE42YDtRClk9k pkQvafgJ7GsShugHSW5dAUCHRkR7lBNJu7qLstIVDibo1gV25lbaE6LB7tkgiBdeROVE hU5KiYB3BtgdM/allx55za3rEWhGy3QbrK/ecBgSwSv9U/atKvT0kxyw0+iwcXP+3gkK J5rFbdTRf9LCEh0EiMb/nMaV9djy0ZeX2N5utpp1gE5fZe28vc//ssqx01gmlgfNi1YW XWoQ== X-Gm-Message-State: AOJu0YyfQXGBTR5Zt4FW5jODJyQCL+Z6FIX4N+CKr8XC4sMKDOCqLyHb u5onBakQG9pof3aYLLags8HAGRPYopzJxjdzJoJHHOELKXro4bfZfDjfYRKPnw== X-Gm-Gg: ASbGncs3+bmlGtgNEMSjh2D9mCe6f1jWvO4XdV+eOPZF1jZj8O6drZXKu3jB/EBMl7p 7HvlHkEjKmabEHFflmXuY+4TLOOE3u0xU6ETJbENCv6UPXv0GPEXxH2Ht5NFyuVqPrfp3rP/67n ysgTZaB7OQZUnHLYeUeueuW6GyLa+InFmPpdOVhI9LTd9VCKu3tSgGtNvfh7tfFjjsSG3H/SWov UWKnp21Jk8yEFKt15H7JoH7D7fqy098SLKhwn8K7eyBGS4FjLzWQ2xeBLuse73kICb+06IOPrZJ ZKGUmMnb0m66F/CDLFbOcxO71rFjC0S4+G52a5xd3YvB356FkxYOghS33Ztgc0GIT6v2ml/98Cw r+ZppJutri19fe646uKW355ubwDBspocKdC7q8kGrj7LLKM0V5VrvSfhceRkEBRbYy1hmNyh1QM bFbubc8BQyOmoGCQoIo08dP1jCmqPJZv/lld49W1mq5skKS32jm82R4zbn5JKiHRnbJsXjTvqHE k59 X-Google-Smtp-Source: AGHT+IGzEyME6I1wx6OjOq9HuE/7Pcx1VeCAJ+xL4tsVp2pjjCSJ0EHvCL56KYdmVYpIqlnwSAFpfA== X-Received: by 2002:a05:6e02:1528:b0:433:3102:b0f5 with SMTP id e9e14a558f8ab-43473dc196fmr4199595ab.30.1762890421855; Tue, 11 Nov 2025 11:47:01 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5b7ab118103sm200534173.53.2025.11.11.11.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Nov 2025 11:47:01 -0800 (PST) Date: Tue, 11 Nov 2025 13:46:59 -0600 From: Nathan Bossart To: Corey Huinker Cc: pgsql-hackers@postgresql.org Subject: Re: vacuumdb: add --dry-run Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Nov 10, 2025 at 05:33:34PM -0500, Corey Huinker wrote: >> My attempts to test this all got stuck in wait_on_slots(). I haven't >> looked too closely, but I suspect the issue is that the socket never >> becomes readable because we don't send a query. If I set free_slot->inUse >> to false before printing the command, it no longer hangs. We probably want >> to create a function in parallel_slot.c to mark slots that we don't intend >> to give a query as idle. > > Would that be preferable to skipping the creation of extra connections for > parallel workers? I can see it both ways. On the one hand we want to give > as true a reflection of "what would happen with these options", and on the > other hand one could view the creation of extra workers as "real" vs a dry > run. I think what I'm proposing actually does skip creating extra connections. If we're immediately marking the first connection as idle, each loop iteration should reuse the same connection. BTW it might be better to modify run_vacuum_command() to skip running the command in dry-run mode. That would also take care of the ONLY_DATABASE_STATS stuff. We should probably do something about the executeCommand() for --analyze-in-stages, too. -- nathan