From 64c604898e812aa93c124c666e8709fff1b8dd26 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 20 Mar 2012 19:05:08 -0400 Subject: 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. --- doc/src/sgml/vacuumlo.sgml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/vacuumlo.sgml b/doc/src/sgml/vacuumlo.sgml index 0ae39c71d2c..97753de6c0c 100644 --- a/doc/src/sgml/vacuumlo.sgml +++ b/doc/src/sgml/vacuumlo.sgml @@ -50,19 +50,22 @@ vacuumlo [options] database [database2 ... databaseN] - username + limit - User name to connect as. + + Remove no more than limit large objects per + transaction (default 1000). Since the server acquires a lock per LO + removed, removing too many LOs in one transaction risks exceeding + . Set the limit to + zero if you want all removals done in a single transaction. + - limit + username - - Stop after removing LIMIT large objects. Useful to avoid - exceeding . - + User name to connect as. @@ -120,18 +123,19 @@ vacuumlo [options] database [database2 ... databaseN] Method - First, it builds a temporary table which contains all of the OIDs of the - large objects in that database. + First, vacuumlo builds a temporary table which contains all + of the OIDs of the large objects in the selected database. It then scans through all columns in the database that are of type oid or lo, and removes matching entries from the - temporary table. + temporary table. (Note: only types with these names are considered; + in particular, domains over them are not considered.) - The remaining entries in the temp table identify orphaned LOs. + The remaining entries in the temporary table identify orphaned LOs. These are removed. -- cgit v1.2.3