public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: shihao zhong <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations
Date: Fri, 27 Mar 2026 13:58:39 -0500
Message-ID: <acbTX__yMnHSMIw4@nathan> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<rzxpxod4c4la62yvutyrvgoyilrl2fx55djaf2suidy7np5m6c@3l2ln476eadh>
	<ab2iXwhRe3fFNPfp@nathan>
	<aglpy2jbnb75vufdx6hqkgokquzmoshcbnuxlcxhum4k7tyi7m@27m4hbxo2u2g>
	<acMGcoUwA9CiPPU1@nathan>
	<loig4i4hc4vuybn6uv6e2kgqm37sebbzujkrvdf6uhbxq5dsfm@7wbkmucts3eu>
	<acQAXPXov4cbyUx0@nathan>
	<[email protected]>
	<acVZ2O0938nWa73w@nathan>
	<[email protected]>

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





view thread (32+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations
  In-Reply-To: <acbTX__yMnHSMIw4@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox