From: | Justin Pryzby <pryzby(at)telsasoft(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: overestimate on empty table |
Date: | 2017-11-11 17:19:45 |
Message-ID: | 20171111171945.GA2167@telsasoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Fri, Nov 10, 2017 at 04:19:41PM -0500, Tom Lane wrote:
> Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> > (or, the opposite of the more common problem)
> > As the queued_alters table is typically empty (and autoanalyzed with
> > relpages=0), I see "why":
>
> > ./src/backend/optimizer/util/plancat.c
> > | if (curpages < 10 &&
> > | rel->rd_rel->relpages == 0 &&
> > | !rel->rd_rel->relhassubclass &&
> > | rel->rd_rel->relkind != RELKIND_INDEX)
> > | curpages = 10;
>
> So I'm sure you read the comment above that, too.
> 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?
Justin
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-11-11 17:43:04 | Re: overestimate on empty table |
Previous Message | Tom Lane | 2017-11-10 21:19:41 | Re: overestimate on empty table |