pgsql: Improve the -l (limit) option recently added to contrib/vacuumlo

Lists: pgsql-committerspgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve the -l (limit) option recently added to contrib/vacuumlo
Date: 2012-03-20 23:05:58
Message-ID: E1SA87q-0002Si-0t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Improve the -l (limit) option recently added to contrib/vacuumlo.

Instead of just stopping after removing an arbitrary subset of orphaned
large objects, commit and start a new transaction after each -l objects.
This is just as effective as the original patch at limiting the number of
locks used, and it doesn't require doing the OID collection process
repeatedly to get everything. Since the option no longer changes the
fundamental behavior of vacuumlo, and it avoids a known server-side
limitation, enable it by default (with a default limit of 1000 LOs per
transaction).

In passing, be more careful about properly quoting the names of tables
and fields, and do some other cosmetic cleanup.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/64c604898e812aa93c124c666e8709fff1b8dd26

Modified Files
--------------
contrib/vacuumlo/vacuumlo.c | 131 +++++++++++++++++++++++++++++++------------
doc/src/sgml/vacuumlo.sgml | 26 +++++----
2 files changed, 109 insertions(+), 48 deletions(-)


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>, Robert Haas <robert(dot)haas(at)enterprisedb(dot)com>
Subject: Re: [COMMITTERS] pgsql: Improve the -l (limit) option recently added to contrib/vacuumlo
Date: 2012-03-21 07:10:28
Message-ID: 4F697EE4.6090308@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 21.03.2012 01:05, Tom Lane wrote:
> Improve the -l (limit) option recently added to contrib/vacuumlo.
>
> Instead of just stopping after removing an arbitrary subset of orphaned
> large objects, commit and start a new transaction after each -l objects.
> This is just as effective as the original patch at limiting the number of
> locks used, and it doesn't require doing the OID collection process
> repeatedly to get everything. Since the option no longer changes the
> fundamental behavior of vacuumlo, and it avoids a known server-side
> limitation, enable it by default (with a default limit of 1000 LOs per
> transaction).
>
> In passing, be more careful about properly quoting the names of tables
> and fields, and do some other cosmetic cleanup.

Shouldn't this be backported? Without it, vacuumlo is effectively broken
in 9.0 and 9.1.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>, Robert Haas <robert(dot)haas(at)enterprisedb(dot)com>
Subject: Re: [COMMITTERS] pgsql: Improve the -l (limit) option recently added to contrib/vacuumlo
Date: 2012-03-21 13:54:53
Message-ID: 29572.1332338093@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> On 21.03.2012 01:05, Tom Lane wrote:
>> Improve the -l (limit) option recently added to contrib/vacuumlo.

> Shouldn't this be backported? Without it, vacuumlo is effectively broken
> in 9.0 and 9.1.

I was wondering about that. You could argue for either "it's a new
feature" or "it's a bug fix". It's a simple enough change that I see
little risk in it, so the argument against backporting seems weak.

If there are not objections, I'll just copy the current vacuumlo code
in toto into 9.0 and 9.1.

regards, tom lane