Re: [PERFORM] overestimate on empty table

From: Tom Lane
Subject: Re: [PERFORM] overestimate on empty table
Date: ,
Msg-id: 4000.1510422184@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: [PERFORM] overestimate on empty table  (Justin Pryzby)
List: pgsql-performance

Tree view

[PERFORM] overestimate on empty table  (Justin Pryzby, )
 Re: [PERFORM] overestimate on empty table  (Tom Lane, )
  Re: [PERFORM] overestimate on empty table  (Justin Pryzby, )
   Re: [PERFORM] overestimate on empty table  (Tom Lane, )

Justin Pryzby <> writes:
> On Fri, Nov 10, 2017 at 04:19:41PM -0500, Tom Lane wrote:
>> One idea is to say that relpages = reltuples = 0 is only the state that
>> prevails for a freshly-created table, and that VACUUM or ANALYZE should
>> always set relpages to at least 1 even if the physical size is zero.

>> Dunno if that would confuse people.

> What about adding && rel->rd_rel->reltuples==0, and make VACUUM/ANALYZE instead
> set only reltuples=1, since that's already done at costsize.c: clamp_row_est()
> and therefor no additional confusion?

1 tuple in 0 pages is a physically impossible situation, so I'm quite
sure that way *would* confuse people.
        regards, tom lane


--
Sent via pgsql-performance mailing list ()
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


pgsql-performance by date:

From: Tom Lane
Date:
Subject: Re: [PERFORM] overestimate on empty table
From: Tom Lane
Date:
Subject: Re: [PERFORM] DB slowness after upgrade from Postgres 9.1 to 9.4