On Fri, Mar 7, 2025 at 6:19 AM wenhui qiu <qiuwenhu...@gmail.com> wrote: > > Sorry ,A wrong version of debug pcnt_visibletuples ,kindly please check the > v3 attachment
I looked at v3. I think I need more than the logging message to understand your goal here. Could you explain the algorithm and why you think it makes sense and what scenarios it is meant to handle better? Thinking about it conceptually, I don't think this makes sense: pcnt_visibletuples = (float4) (livetuples / (livetuples + vactuples)); vacthresh = (float4) vac_base_thresh + vac_scale_factor * reltuples * pcnt_visibletuples do_vacuum = vactuples > vacthresh livetuples + deadtuples is approx reltuples (little more complicated than this, but), so this is basically livetuples/reltuples*reltuples -> livetuples So vactuples > vacthresh is basically just deadtuples > livetuples Maybe you think that we should be comparing the portion of the table that is dead to the portion of the table that is live, but that doesn't seem to be what you mean the algorithm to do based on the one comment you have. The anlthresh calculation is a different discussion, since mod_since_analyze is calculated in a different way (tuples updated + tuples inserted + tuples_deleted). But I am also skeptical of this one. I think you need to explain more conceptually about why you think these ways of calculating the thresholds makes sense. - Melanie