Re: how to shrink pg_attribute table in some database

Поиск
Список
Период
Сортировка
От Artem Tomyuk
Тема Re: how to shrink pg_attribute table in some database
Дата
Msg-id CANYYVq+5Og_e=d4h4uvuh3s-e1PfdR5t1QeStPKoR24q_DdZfw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to shrink pg_attribute table in some database  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: how to shrink pg_attribute table in some database
Список pgsql-admin
Can't, it generates huge IO spikes.

But....

Few hours ago i manually started vacuum verbose on pg_attribute, now its finished and i have some outputs:

INFO: "pg_attribute": found 554728466 removable, 212058 nonremovable row versions in 44550921 out of 49326696 pages DETAIL: 178215 dead row versions cannot be removed yet. There were 53479 unused item pointers. 0 pages are entirely empty. CPU 1097.53s/1949.50u sec elapsed 6337.86 sec. Query returned successfully with no result in 01:47:3626 hours.

what do you think?

select count(*) on pg_attribute returns:
158340 rows

So as i understand vacuum full will create new pg_attribute and will wrote those amount of "valid" rows, but still it will scan 300GB old table?
So estimate will be even ~same compering with regular vacuum?
 

2018-03-26 17:17 GMT+03:00 hubert depesz lubaczewski <depesz@depesz.com>:
On Mon, Mar 26, 2018 at 05:15:14PM +0300, Artem Tomyuk wrote:
> For now pg_attribute bloated to 300GB in size, and we have only 260GB's of
> free space on disk.
> In normal situation pg_attribute takes 50mb in size for our DB...
> Can we assume that if we will run vacuum full on pg_attribute it will take
> additional 50MB on disk?

You can estimate by doing:

create table z as select * from pg_Attribute;

and then checking size of z.

bloat there suggests that you have huge churn in tables - like: create
table, drop table, lots of times.

Best regards,

depesz


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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: how to shrink pg_attribute table in some database
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: how to shrink pg_attribute table in some database