Re: [PROPOSAL] VACUUM Progress Checker.

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PROPOSAL] VACUUM Progress Checker.
Date: 2015-07-31 03:30:26
Message-ID: CAH2L28tHrZLpGtwkofKUV8igpa6+mF60R-HBg2Gkh42tczg5JQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>I think it's related to the problem of figuring out how many dead tuples
you expect to find in the overall heap, which you need to do to have >any
hope of this being a comprehensive estimate.

An estimate of number of index scans while vacuuming can be done using
estimate of total dead tuples in the relation and maintenance work mem.
n_dead_tuples in pg_stat_all_tables can be used as an estimate of dead
tuples.

Following can be a way to estimate,

if nindexes == 0
index_scans =0
else if pages_all_visible
index_scans =0
else
index_scans = Max((n_dead_tuples * space occupied by single dead
tuple)/m_w_m,1)

This estimates index_scans = 1 if n_dead_tuples = 0 assuming lazy scan heap
is likely to find some dead_tuples.
If n_dead_tuples is non zero the above estimate gives a lower bound on
number of index scans possible.

Thank you,
Rahila Syed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-07-31 04:41:39 Re: Reduce ProcArrayLock contention
Previous Message Andres Freund 2015-07-31 03:22:34 Re: LWLock deadlock and gdb advice