Re: New vacuum option to do only freezing
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, "Bossart,
Nathan" <bossartn@amazon.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-04-16T10:25:16Z
Lists: pgsql-hackers
On Tue, Apr 16, 2019 at 4:47 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Robert Haas <robertmhaas@gmail.com> writes: > > On Mon, Apr 15, 2019 at 1:13 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > >> I have a very strong feeling that this patch was not fully baked. > > > I think you're right, but I don't understand the comment in the > > preceding paragraph. How does this problem prevent tupgone from > > getting set? > > My point is that I suspect that tupgone *shouldn't* get set. > It's not (going to be) gone. > > > It looks to me like nleft_dead_tuples should be ripped out. > > That was pretty much what I was thinking too. tups_vacuumed counts not only (1)dead-but-not-yet-removable tuple but also HOT-pruned tuples. These HOT-pruned tuples include both (2)the tuples we removed both its itemid and tuple storage and the tuples (3)we removed only its tuple storage and marked itemid as dead. So we cannot add tups_vacuumed to nkeeps as it includes completely removed tuple like tuples-(2). I added nleft_dead_itemids to count only tuples-(3) and nleft_dead_tuples to count only tuples-(1) for reporting. Tuples-(2) are removed even when index cleanup is disabled. > It makes more sense > just to treat this case identically to dead-but-not-yet-removable. > I have substantial doubts about nleft_dead_itemids being worth > anything, as well. I think that the adding tuples-(3) to nkeeps would be a good idea. If we do that, nleft_dead_tuples is no longer necessary. On the other hand, I think we need nleft_dead_itemids to report how many itemids we left when index cleanup is disabled. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
Commits
-
Add toast-level reloption for vacuum_index_cleanup
- ce59b75d449d 12.0 landed
-
heap_prepare_freeze_tuple: Simplify coding
- 2bf372a4ae26 12.0 landed
-
Fix missing word.
- 6665305e17ed 12.0 landed
-
Allow VACUUM to be run with index cleanup disabled.
- a96c41feec6b 12.0 landed
-
Don't mark pages all-visible spuriously
- d2599ecfcc74 11.0 cited