Re: tableam: abstracting relation sizing code - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: tableam: abstracting relation sizing code
Date
Msg-id 20190610194648.GA9230@alvherre.pgsql
Whole thread Raw
In response to Re: tableam: abstracting relation sizing code  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: tableam: abstracting relation sizing code
List pgsql-hackers
On 2019-Jun-10, Robert Haas wrote:

> On Fri, Jun 7, 2019 at 6:42 PM Daniel Gustafsson <daniel@yesql.se> wrote:

> > The commit message still refers to it as estimate_rel_size though. The comment on
> > table_block_relation_estimate_size does too but that one might be intentional.
> 
> Oops.  New version attached, hopefully fixing those and the compiler
> warning Alvaro noted.

It does fix the warning, thanks.

> > Maybe I’m a bit thick but if the rel is totally empty and without children,
> > then curpages as well as relpages would be both zero.  But if so, how can we
> > enter the second "quick exit” block since curpages by then will be increased to
> > 10 in the block just before for the empty case?  It seems to me that the blocks
> > should be the other way around to really have a fast path, but I might be
> > missing something.
> 
> Well, as you say, I'm just moving the code.

I agree that you're just moving the code, but this seems to have been
recently broken in 696d78469f37 -- it was correct before that (the
heuristic for never vacuumed rels was in optimizer/plancat.c).  So in
reality the problem that Daniel pointed out is an open item for pg12.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: tableam: abstracting relation sizing code
Next
From: "Goel, Dhruv"
Date:
Subject: Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY