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 1w6CON-0043Cm-17 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 18:58:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6COL-00BWgS-0L for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 18:58:45 +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 1w6COK-00BWgJ-2f for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 18:58:45 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6COJ-00000001Moi-2Gsi for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 18:58:44 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7d9b21d1461so2032927a34.1 for ; Fri, 27 Mar 2026 11:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774637923; x=1775242723; 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=nTKZCZ7w1lPJKFXpDTVeDvSqfOp88x+l0JXGjQBzH0w=; b=hMVxDJT7Pp8hIe8Mkd4GQ7v6EtYvVrr+Cktne2a2LMBfG1X8z/mB4Gdt5seqErlF3f mUTtABUvaOiMTDgKP97HpR8Wkiqk9X04lcM56aBB/zOGaNRMihbvnHm0P6EBFjWEY1wr MPRBa/mtfKds6Gu2wIyx5Dgh3bVOa1ooizmRfOEqI9hoVvWQBs9QWl70FVzNfh3yC+Ky AaKIDWEqhc6BoYx1pSr6rO5uW61SUq5/wRKZq+2MZFC1XE8GVvMw2tEAGch4AzmgU6P/ 9aT4wmGpAreZVk/cCJwkBW+VFCRSGXDOvT96eNLlQzAc12OGgJX6ZgnDQfmgQtcWf96u EvHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774637923; x=1775242723; 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=nTKZCZ7w1lPJKFXpDTVeDvSqfOp88x+l0JXGjQBzH0w=; b=fNLfDxI/xHeRSJ2+5P9hjP6UEO+XwXswfHMsokgTFluqlhQ0C6m/5yfTLe5Nons+2u YfY+ioISH6/6BxtGsWMKB0cRZkqMNVP5lKug+55EG3dwd98nV5qBs9IJHp6d+DMTrTTM x4fbJM6iB2ipumMYCP1A3tsnw9POUnh6qKx5Mc8kXMW4hlMQG4qbTMI2D2pMVo0Thyjk h3VCwbFONRNT5RTrTUyIz2+yo7Hi9pyBkHMD6pS88l9t48PqlzQyby+lzk/WMMWK29qY mxauOXi/Uj4UYmWXaCMm8xZgGhJ3TVYN7Y/AHeubHs+Py8p3SEoEGi3CbVLZieWqIPVl nFCQ== X-Forwarded-Encrypted: i=1; AJvYcCXZePS92Xo0qlsCPFoZaG0ienRmLZPxmRnX8rvJxHZ/EkeNW7/LKXOHYF1iEEn4nB3oa7XSsV4BAGA49Guz@postgresql.org X-Gm-Message-State: AOJu0YzkYHZB9WDA8dPo5bYdsdbNfn4R57EyyGCGhjzV83YF2t5CPBuR 4TfcQfuHYrgDWccXAkqtF+F3Y6K2aORs2vKbqxL+addT9x3lPCgvSv52 X-Gm-Gg: ATEYQzxm0KbihL+RM4ljwlF9LFYlyYYzV1FWed8+kLyMvZDgqcUMDPP71viL6tgLuZd TF1HwRIbfGGId93FXEmqozbDCnhGT7WvsOsKpFxEfzDEHRFjoSPEwhfLjW3kO37sorDfUaqjW61 7M/LQ9IJApflbEFscZOu3h41ucw2+ApAjQpsgeCnCFo1PL+nIajcMiFkM3Xb+n53TNVHSWk/3ca pYSbImfpf5IALqh0XeLHVozDcYtFyT+oocUurdnCeS2UjdMG7o+oFWjXsvkk0Jr1cUiMO7peiFW FOoCcptHZeBKFfJv8d/b9UpXFHwv9PphhC99/XdbXJ8cbRqPCmCj0wIUxkXsE1S5tjKUUnvpsYV 33nvcPoyflxegUKbDJOkjey3toBLp1yM5TCkuOo5C6LRMQbJ4wUKd1lKeyqa1SgHwMbfBrAURcb nkVh5uIDW+ujxRut8TUTvFbvIdMQJK8KIEoXWi+rQrjckopkP1YXM+iyAxOBq50xqbH5pRk+nTu Zw3WQg0U2vXFeGCwEsny/P0js76+Kwm X-Received: by 2002:a05:6830:488f:b0:7d7:dcbb:280b with SMTP id 46e09a7af769-7d9fae96870mr1652843a34.1.1774637923042; Fri, 27 Mar 2026 11:58:43 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7da0a7b5b41sm36319a34.15.2026.03.27.11.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 11:58:42 -0700 (PDT) Date: Fri, 27 Mar 2026 13:58:39 -0500 From: Nathan Bossart To: Michael Paquier Cc: Andres Freund , shihao zhong , PostgreSQL-development Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations 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 Fri, Mar 27, 2026 at 08:03:30AM +0900, Michael Paquier wrote: > Still, I slightly prefer your v2, where the interface of vacuum_rel() > is leaner with all the other ones. It comes at the cost of copying > the input parameters into a temporary "copy" of VacuumParams, but I > see the fact of marking the input "params" with a const as more > valuable in the long-run, with less temptation to manipulate it > directly especially it is not not marked with a const. One small > worry with v3 is that people like copy-pasting code around, and I > suspect that v2 could discourage better the patterns that 2252fcd4276c > has tried to improve and that 661643dedad9 had to fix. I disagree with you here. By passing the struct by-value, we are avoiding scribbles on the original one without an explicit memcpy and without a big comment warning folks to only use the copy (which seems like it'd be easy to miss). I think using a const pointer in most places makes sense, but not if we need to immediately copy the contents to a local variable anyway. -- nathan