Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Michael Paquier
On Tue, Aug 4, 2015 at 2:04 AM, Simon Riggs wrote: > On 3 August 2015 at 17:36, Tom Lane wrote: >> >> Alvaro Herrera writes: >> > Simon Riggs wrote: >> >> * For emergency anti-wraparound VACUUMs we shouldn't scan indexes at >> >> all, >> >> since they aren't critical path activities at that poin

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Jim Nasby
On 8/3/15 12:04 PM, Simon Riggs wrote: Yes, that's what I was thinking, I just didn't say actually it. I'd been thinking about having VACUUM do just Phase 1 for some time, since its so much faster to do that. Will code. I'd like to see that exposed as an option as well. There are certain situa

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Robert Haas
On Mon, Aug 3, 2015 at 4:13 AM, Simon Riggs wrote: > * For normal VACUUMs we should scan indexes only if (num_dead_tuples * 20) > > (blocks to be scanned in any one index), which allows some index bloat but > not much I think this kind of heuristic is good, but I think we should expose a setting

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Robert Haas
On Mon, Aug 3, 2015 at 11:52 AM, Alvaro Herrera wrote: > Simon Riggs wrote: >> * For emergency anti-wraparound VACUUMs we shouldn't scan indexes at all, >> since they aren't critical path activities at that point > > It is not possible to skip scanning indexes completely, unless no tuples > are to

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Simon Riggs
On 3 August 2015 at 17:36, Tom Lane wrote: > Alvaro Herrera writes: > > Simon Riggs wrote: > >> * For emergency anti-wraparound VACUUMs we shouldn't scan indexes at > all, > >> since they aren't critical path activities at that point > > > It is not possible to skip scanning indexes completely,

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Tom Lane
Alvaro Herrera writes: > Simon Riggs wrote: >> * For emergency anti-wraparound VACUUMs we shouldn't scan indexes at all, >> since they aren't critical path activities at that point > It is not possible to skip scanning indexes completely, unless no tuples > are to be removed from the heap. Right

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Alvaro Herrera
Simon Riggs wrote: > * For emergency anti-wraparound VACUUMs we shouldn't scan indexes at all, > since they aren't critical path activities at that point It is not possible to skip scanning indexes completely, unless no tuples are to be removed from the heap. Otherwise, index tuples become linge

Re: [HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-03 Thread Simon Riggs
On 2 August 2015 at 13:13, Michael Paquier wrote: > Hi all, > > Commit 4046e58c (dated of 2001) has introduced the following comment > in vacuumlazy.c: > + /* If any tuples need to be deleted, perform final vacuum cycle */ > + /* XXX put a threshold on min nuber of tuples here? */ > +

[HACKERS] Minimum tuple threshold to decide last pass of VACUUM

2015-08-02 Thread Michael Paquier
Hi all, Commit 4046e58c (dated of 2001) has introduced the following comment in vacuumlazy.c: + /* If any tuples need to be deleted, perform final vacuum cycle */ + /* XXX put a threshold on min nuber of tuples here? */ + if (vacrelstats->num_dead_tuples > 0) In short, we may wan