Re: [PATCH] vacuumlo: print the number of large objects going to be removed

Поиск
Список
Период
Сортировка
От Timur Birsh
Тема Re: [PATCH] vacuumlo: print the number of large objects going to be removed
Дата
Msg-id 1871151560487721@myt3-c7e5d17fe013.qloud-c.yandex.net
обсуждение исходный текст
Ответ на Re: [PATCH] vacuumlo: print the number of large objects going to beremoved  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: [PATCH] vacuumlo: print the number of large objects going to beremoved  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-hackers
13.06.2019, 13:57, "Michael Paquier" <michael@paquier.xyz>:
> On Thu, Jun 13, 2019 at 01:25:38PM +0600, Timur Birsh wrote:
>>  Just to be sure, a new command line argument needs to be added for
>>  reporting the numbers? Should it implies --verbose argument?
>
> Nope. I mean that running a SELECT count(*) can be costly for many
> items.

Understood, thanks.

I found a way to get the number of LOs that will be removed without
the SELECT count(*) - PQcmdTuples(). Please find attached patch v2.
I fixed some indentation in the variable declaration blocks.

There is a database with tables that have a lot of tuples with large objects:

# select count(*) from pg_largeobject_metadata;
  count
----------
 44707424
(1 row)

An application that uses this database from time to time deletes and adds a lot
of rows, it happens that more than 10,000,000 orphaned LOs remain in the
database. Removing such a number of items takes a long time.
I guess, it would be helpful to know how many LOs going to be removed and
report deleted percentage.

Thanks,
Timur
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: ldapbindpasswdfile
Следующее
От: Ian Barwick
Дата:
Сообщение: [PATCH] Stop ALTER SYSTEM from making bad assumptions