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 1v28mY-000gZM-Jp for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 13:46:42 +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 1v28mW-001f6C-13 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 13:46:40 +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 1v28mV-001f63-MO for pgsql-hackers@lists.postgresql.org; Fri, 26 Sep 2025 13:46:40 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v28mT-000EFi-28 for pgsql-hackers@lists.postgresql.org; Fri, 26 Sep 2025 13:46:39 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-62faeed4371so3045381a12.1 for ; Fri, 26 Sep 2025 06:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1758894396; x=1759499196; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6kCUlflnv0lAlnnwc0fnoUAMP6lvcEfegbaBjn5Eo1U=; b=PFhzgcJnOe4D201ihz89NvQG7OqLKlfedgdARnI3+2V2VY3SD9AIZyBklxM/SuoY4m D06GxtUPlpGFzuf0OrID5EeHtqnH8xhnT/09IDIQWWOnAibkVnnNAvOwqHEYBv1RTRge zcoEdbDAnRut9gPbVsqolQkVSCnG8k6WvJh9CojJq+5e4FUHBpJ0+SwWkdyuo4qcIKZL BgOtUSzQrkpchuMX1JNdv8l6+FurFTCwcGeeqPhRHSYVQm8oW/PGwj/qa6H6M/vUnOMQ +rR+puDXCW1fA64uEShTOJgantL0PXVdQjnHJbYi2E7H6Wa1Si0ZHEXPeFvUmsSj2VHr kl9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758894396; x=1759499196; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6kCUlflnv0lAlnnwc0fnoUAMP6lvcEfegbaBjn5Eo1U=; b=q5pZFQM+In6ZGB/clSoNZGLkvf107T8zxG3hAKdHfaoeQJDaoGDQhd89oqqICK/AKv EogJqsWlFO56uUFvkfu+45LyHzKqJNCtOR3z/bx7NAsQ9XZUI/wp0vRAEX5AlB/RaK9Y A+hjkGaJfn/Dv9KvYwI8qLg45qyHI9vO9/wbkbrGZqJvP6zL6znxg5z4QiTgTs1xwzg/ 76Ku60r0KO95Ol59mHCTfsyIWa4mBLU7LJBNwMrEVrMVifw4J0UfYWjmeInzLFaRinee cGY4hUSmsuXagT1dWQRVDQDr53pSrneb8eCvQGul1Amfwmlg6wBHeEo+lz35MLclehj+ UZvw== X-Gm-Message-State: AOJu0YywMEGJQIlSVMEGHFp86j6DTOX6PrzqqTPmqKind8GBZWnZ3pTJ D48Lp5BypVxyFhAZStvqwGunT7shCdLP9r/4BoCSkOnW9Nkd+l5dvupP3dED4aftW1lO9aR0+Kh 9LvnS X-Gm-Gg: ASbGncsHoyhzRBNuS2zM0RLt2zS7rrO1zYbxVSE7EAEwRarImZY2cSnqrKGarj0cvkj geDRyXyRh125B0pFyTLYlOG3bZ86Ewz8bGjjgj1/JoWmLVjB+rPZBFiih9IAKoUHfSPpoN4Ej2k AFxAZ8xGzlv8t0V7b4mukvAx0qpyixKY+w+ioxu5nU8FEwUmfnN+UF6v8SeYQzJDTAGAdSP5AQO xrPRo70J6MMxp6TorhLddmh4OME6NT2YfhARlvXHN9hkMKUiT9hrhXf4QRa3JjyeQC1Z/YnKpAh omzqWGyDZJPxmaqAGn5OrYZIoKjeDfEH3AKxq+aAn0YNF5Qj5REraF+mrio4QVlx+0rMEGQHl7J 4wHSl6xYIcZSn6eEi6l2JXZsONAG11X6DNoEm X-Google-Smtp-Source: AGHT+IGSK9N5x/gY/39ozFyJZxwbNoDBw73HX0YpLalP0bhLt0UQxkQoOvKa9SC9ysKrD4IolSUwTQ== X-Received: by 2002:a17:907:94c1:b0:b2c:fa32:51d3 with SMTP id a640c23a62f3a-b34b91a8803mr927320166b.3.1758894396297; Fri, 26 Sep 2025 06:46:36 -0700 (PDT) Received: from localhost (109-81-168-144.rct.o2.cz. [109.81.168.144]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-634a3b05779sm2955585a12.49.2025.09.26.06.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 06:46:35 -0700 (PDT) From: Antonin Houska To: alvherre@kurilemu.de cc: Pg Hackers Subject: Re: splitting src/bin/scripts/vacuumdb.c In-reply-to: <202509261126.lqdaq6uvo2m2@alvherre.pgsql> References: <202509261126.lqdaq6uvo2m2@alvherre.pgsql> Comments: In-reply-to =?us-ascii?Q?=3D=3Futf-8=3FQ=3F=3DC3=3D81lvaro=3F=3D?= Herrera message dated "Fri, 26 Sep 2025 13:55:50 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Sep 2025 15:46:35 +0200 Message-ID: <48811.1758894395@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =C3=81lvaro Herrera wrote: > - 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: >=20 > - /* If we used SKIP_DATABASE_STATS, mop up with ONLY_DATABASE_STATS */ > - if (vacopts->skip_database_stats && stage =3D=3D ANALYZE_NO_STAGE && > - !vacopts->analyze_only) > - { >=20 > + /* If we used SKIP_DATABASE_STATS, mop up with ONLY_DATABASE_STATS */ > + if (vacopts->mode =3D=3D MODE_VACUUM && vacopts->skip_database_stats) > + { >=20 > IMO the original is quite unclear. I agree that redundant information makes things more difficult to think about. I just wonder if vacopts->mode !=3D MODE_VACUUM should be used instead of (vacopts->mode =3D=3D MODE_ANALYZE || vacopts->mode =3D=3D MODE_ANALYZE_IN_STAGES) in some places. Nevertheless, I'm not proposing a global replacement: the verbose form may be easier to understand, depending on the context. Other than that, I checked differences between v21, v22 and v23. I've got no other comments worth posting. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com