Skip site navigation (1) Skip section navigation (2)

Re: Estimation error in n_dead_tuples

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Estimation error in n_dead_tuples
Date: 2007-02-01 16:57:31
Message-ID: 19286.1170349051@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> I'm thinking to add "the number of vacuumed tuples" to the message from
> vacuum. The stats collector will subtract the value from n_dead_tuples
> instead of setting it to zero. This is also needed if we want to make
> some kinds of "partial" vacuum methods.

This seems awfully dangerous to me, because then you are operating on
dead reckoning forever: there will be nothing that can correct an
inaccurate rowcount estimate, and in practice that means it will diverge
arbitrarily far from reality :-(, because of the inherent inaccuracies
of the stats system.  I think the risk of that is far worse than the
relatively small (or at least bounded) error arising from tuples not
seen by vacuum.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-02-01 17:08:48
Subject: Re: stack usage in toast_insert_or_update()
Previous:From: Jan WieckDate: 2007-02-01 16:51:46
Subject: Re: stack usage in toast_insert_or_update()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group