Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Peter Geoghegan
On Thu, Feb 17, 2022 at 4:18 PM Andres Freund wrote: > > What substantial changes are you referring to? The one thing that did > > change was the commit message, which framed everything in terms of the > > later work. It really is true that the patch that I committed was > > essentially the same p

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Andres Freund
Hi, On 2022-02-17 14:23:51 -0800, Peter Geoghegan wrote: > On Thu, Feb 17, 2022 at 10:33 AM Andres Freund wrote: > > On 2022-02-16 19:43:09 -0800, Peter Geoghegan wrote: > > > It makes the code in vacuumlazy.c much cleaner. In fact, that's how commit > > > 44fa8488 started off -- purely as refact

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Peter Geoghegan
On Thu, Feb 17, 2022 at 10:33 AM Andres Freund wrote: > On 2022-02-16 19:43:09 -0800, Peter Geoghegan wrote: > > It makes the code in vacuumlazy.c much cleaner. In fact, that's how commit > > 44fa8488 started off -- purely as refactoring work. > > The problem is that it didn't end up as that. You

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Peter Geoghegan
On Thu, Feb 17, 2022 at 1:36 PM Robert Haas wrote: > > It's not that simple. As I said in the fix-up commit message, and in > > the opening email to this thread, it basically isn't a new behavior at > > all. It would be much more accurate to describe it as a behavior that > > originated with commi

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Robert Haas
On Thu, Feb 17, 2022 at 4:10 PM Peter Geoghegan wrote: > > I would say it differently: I think the commit message does a poor job > > describing what the commit actually does. For example, it says nothing > > about changing VACUUM to always scan the last page of every heap > > relation. This whole

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Peter Geoghegan
On Thu, Feb 17, 2022 at 6:17 AM Robert Haas wrote: > Let's back up a minute and talk about the commit of $SUBJECT. The > commit message contains a Discussion link to this thread. This thread, > at the time you put that link in there, had exactly one post: from > you. That's not much of a discussio

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Andres Freund
Hi, On 2022-02-16 19:43:09 -0800, Peter Geoghegan wrote: > It makes the code in vacuumlazy.c much cleaner. In fact, that's how commit > 44fa8488 started off -- purely as refactoring work. The problem is that it didn't end up as that. You combined refactoring with substantial changes. And describe

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Andres Freund
Hi, On 2022-02-17 09:17:04 -0500, Robert Haas wrote: > Commit messages need to describe what the commit actually changes. > Theoretical ideas are fine, but if I, as a committer who have done > significant work in this area in the past, can't read the commit > message and understand what is actuall

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Robert Haas
On Wed, Feb 16, 2022 at 10:43 PM Peter Geoghegan wrote: > How can you be surprised that I committed 44fa8488? It's essentially > the same patch as the first version, posted November 22 -- almost 3 > months ago. And it's certainly not a big patch (though it is > complicated). Let's back up a minut

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-17 Thread Justin Pryzby
On Wed, Feb 16, 2022 at 07:43:09PM -0800, Peter Geoghegan wrote: > > I also have a hard time making heads or tails out of the commit message of > > 44fa84881ff. It's quite long without being particularly descriptive. The > > commit just changes a lot of things at once, making it hard to precisely >

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-16 Thread Peter Geoghegan
On Wed, Feb 16, 2022 at 7:08 PM Andres Freund wrote: > I'm quite worried about the pace and style of the vacuum changes. To me it > doesn't look like that there was design consensus before 44fa8488 was > committed, quite the opposite (while 44fa8488 probably isn't the center of > contention, it's

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-16 Thread Andres Freund
Hi, On 2022-02-16 17:16:13 -0800, Peter Geoghegan wrote: > On Sun, Feb 13, 2022 at 1:43 PM Peter Geoghegan wrote: > > This fixes the observed problem directly. It also makes the code > > robust against other similar problems that might arise in the future. > > The risk that comes from trusting th

Re: Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-16 Thread Peter Geoghegan
On Sun, Feb 13, 2022 at 1:43 PM Peter Geoghegan wrote: > This fixes the observed problem directly. It also makes the code > robust against other similar problems that might arise in the future. > The risk that comes from trusting that scanned_pages is a truly random > sample (given these condition

Nonrandom scanned_pages distorts pg_class.reltuples set by VACUUM

2022-02-13 Thread Peter Geoghegan
My recent commit 44fa8488 made vacuumlazy.c always scan the last page of every heap relation, even when it's all-visible, regardless of any other factor. The general idea is to always examine the last page in the relation when that might prevent us from unsuccessfully attempting to truncate the rel