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

Re: Estimation error in n_dead_tuples

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Estimation error in n_dead_tuples
Date: 2007-02-02 02:47:50
Message-ID: 20070202105422.59FD.ITAGAKI.TAKAHIRO@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> > 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 seems awfully dangerous to me, because then you are operating on
> dead reckoning forever

Ah, I see. We need 'reset' of statistics sometimes.

Now I'll propose to save the n_dead_tuples value at the beginning of
vacuum, and send the value with a stat message to subtract. The added
number to n_dead_tuples during vacuum will be left.
(This is true for now, but will be incorrect after "Recalculating
OldestXmin in a long-running vacuum" patch is commited.)

I'll send a patch that adds the above to patches.


> > This is also needed if we want to make
> > some kinds of "partial" vacuum methods.

We can adjust the number of vacuumed tuples for patial vacuums
that scan a part of heap pages. For example,
  n_dead_duples_at_start * scanned_pages / rel_pages .
We can also use the actually removed tuples in vacuum for adjustments.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



In response to

pgsql-hackers by date

Next:From: Jeremy DrakeDate: 2007-02-02 03:29:35
Subject: Re: [HACKERS] writing new regexp functions
Previous:From: Koichi SuzukiDate: 2007-02-02 02:05:52
Subject: Re: [HACKERS] Full page writes improvement

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