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 1v29EW-000lRv-05 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 14:15:36 +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 1v29ET-001tRo-VH for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 14:15:34 +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 1v29ET-001tRg-Jb for pgsql-hackers@lists.postgresql.org; Fri, 26 Sep 2025 14:15:34 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v29ES-000ETz-0F for pgsql-hackers@lists.postgresql.org; Fri, 26 Sep 2025 14:15:33 +0000 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-8ca2e53c0d3so102234039f.1 for ; Fri, 26 Sep 2025 07:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758896130; x=1759500930; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=aW2MKzcve84r2JEj45vV16PhXrrWANuBPh1ce5qS4sU=; b=fTs0Knuu/9LLG0Flfe15fGBtI3Z9U61FM9lSyFM6M9Pv/52uNItc+nTFravIJSpPSl NrOzF32E70rs5H5RPfyNaXZ6NPTxrnp1Oqoi2A24VVkycyrYP20pqtGaEx2ZrLyqjRzV gat8kpG7QmUrd20UhGCjZNBJvzApexFFq3Be6kHtIHMUbdls1aKMDq989Qll+44v1JtS MolUfdB0YDEjwZAJszSCJMeSyambnRZ6KBNNgSF8auNJ7qdZVOZ5t8D9Q1+6bwmJZ4p7 k+4wUcDvzJqRG2q9Aknry/e8x8wxAeuX1xaYxO5THr1854LtYVpvsIzl8eGbM5HxcTQi NHHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758896130; x=1759500930; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aW2MKzcve84r2JEj45vV16PhXrrWANuBPh1ce5qS4sU=; b=uCTmh7BICQ6EJSILh5H2paCOvjAz+u4r34PLdhUlXHzYT7wYZJ2yGcksCAfOCGaJQb RGtbYORQ4YDbH7dVR2ezd3VtqmTJES7HTvK5Puu8ETZNzs6Z186GqrZ1RdVdMCOVOfNw rdL7ynmMD5SGOXTqBJpRsyULMtqetpDsMHAkkR1gv/k1E/BwaG1luCCdXXu6DRPg8tP6 zNL5zZFNjTwQ6e+Efw6ejDyLxDkwcZXXqutz4mOQqA9QPHncRS9KYdVdvBASaMglYUVr F0fW6VSE6nCzIUSR/o0qMSX9dRIf+X8Tf+pPDTUaoOlmtRqF0YzZi/J6oqqjkILnZ0C9 l+Nw== X-Gm-Message-State: AOJu0YzZSukfzevcrcZvP9CCKoUXzCVHin3B/F4h/xnSjO+iigBYlnsV rJdgofXrOCnHRtjbuHO+pY0KuIn3/4cACFtVE/4aUdrEQYl7KSR2/Zm6c09mkQ== X-Gm-Gg: ASbGncvDuF28A6bhjq4os7mm4eGRkS6t/R3rgkOmVgVPT+yWrzU8JZcXg1rrfuFWc5e fnhIGQgSAxUJqkgTBZB39MUosB7gNMbxt+bM25KYue9g09/400ycVcInCWJJmkVoiLEdpkUPocR MQHrEaJ6bLRlfaBfSyMQiVCwNAb07cFOaI+7eHzEP9Fzwez4NwvhifS/zKHnjztU4si99fZzJie msUJCZ3gNanJi5Ug/0XTMjoi7bsneX2OIh3LE1bMieWVXkPj6E4YWJFdDRwRq9ixZ8zmwNcLdJ4 Dfq+bjPRACd4QgsRsUvOIUGw/HXZqZwYoJSacDRqxIJNpeiHYQcesiQKveP6DKfgDpF2DRJ9uIi J1sY6VC3pqUQcFuL5RDXhdYsG3jXkQq4WtZ3ZKUI5ScJa66gHVgQ4w2/SA+A3LB7SeCPXF3wEoq BxfC6CZrRoN1OZ5t+BXpRnL8A= X-Google-Smtp-Source: AGHT+IHm1TK0prMpVVNsw/sJGaZxHdaafNgewszqWqFd3zQzM0Z7242OSXsR5UfiU+Msm14rtU2MGA== X-Received: by 2002:a05:6e02:3c83:b0:426:c373:25db with SMTP id e9e14a558f8ab-426c3732a86mr65255285ab.4.1758896127147; Fri, 26 Sep 2025 07:15:27 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-4281b14cac0sm2112275ab.5.2025.09.26.07.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 07:15:26 -0700 (PDT) Date: Fri, 26 Sep 2025 09:15:25 -0500 From: Nathan Bossart To: =?utf-8?Q?=C3=81lvaro?= Herrera Cc: Pg Hackers Subject: Re: splitting src/bin/scripts/vacuumdb.c Message-ID: References: <202509261126.lqdaq6uvo2m2@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202509261126.lqdaq6uvo2m2@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 26, 2025 at 01:55:50PM +0200, Álvaro Herrera wrote: > - objfilter is declared as an enum but the values are bit-or'ed and > tested for individual bits. We've discussed this coding pattern in > other contexts and stayed away from it, on the grounds that the values > so generated aren't really true values of the enum. I changed it from > an enum to a bits32 with a few #defines for the values we use, the way > we do elsewhere. Also, instead of being passed as a separate argument > to the various functions, I added it to the vacuumingOpts struct. > > - Two booleans, analyze_in_stages and analyze_only, are really > determining what "mode" the program runs in -- it's either vacuum, or > one of those two modes. (Antonin came up with the idea of using > "modes", but his patch only adds a new REPACK mode on top of the > existing code without any further changes). I think the code flow is a > little neater by making this change; consider for instance this change: Seems reasonable to me. > Overall I'm quite happy with this small patch now, so I intend to push > shortly barring objections. I'm not adding a new commitfest entry, just > adding this new thread to the existing entry for REPACK. I kept the > patch numbering as used in the other thread. Is there any way to separate the aforementioned changes into a separate patch from the refactoring changes? That would make it a lot easier to review. I think we have decent testing for vacuumdb, so I'm not too concerned if this isn't feasible. -- nathan