Re: [GENERAL] Table not cleaning up drom dead tuples

Поиск
Список
Период
Сортировка
От Glyn Astill
Тема Re: [GENERAL] Table not cleaning up drom dead tuples
Дата
Msg-id 953788998.9053462.1489499619888@mail.yahoo.com
обсуждение исходный текст
Ответ на [GENERAL] Table not cleaning up drom dead tuples  (Антон Тарабрин <tarabanton@gmail.com>)
Ответы Re: [GENERAL] Table not cleaning up drom dead tuples
Список pgsql-general

> From: Антон Тарабрин <tarabanton@gmail.com>
> To: pgsql-general@postgresql.org
> Sent: Tuesday, 14 March 2017, 12:09
> Subject: [GENERAL] Table not cleaning up drom dead tuples

> General info about  our database:

> https://gist.github.com/aCLr/dec78ab031749e517550ac11f8233f70
>
> Information about problematic tables:
> https://gist.github.com/tarabanton/edf7f8dc26eb7ec37a9cfa3424493871
>
> As you can see, there 2 to 10 times dead tuples compared to actual row count.
> We've tried VACUUM FULL and CLUSTER without any success.
> There is no long term locks, idle in transaction requests or prepared transactions.
>
> We are temporarily fixing this like that:
> BEGIN;
> CREATE TABLE _orders_temp (LIKE orders_y2017_m3 INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES INCLUDING
COMMENTS);
> INSERT INTO _orders_temp select * from orders_y2017_m3;
> ALTER TABLE orders_y2017_m3 RENAME TO __orders_y2017_m3_to_drop;
> ALTER TABLE __orders_y2017_m3_to_drop NO INHERIT orders;
> ALTER TABLE _orders_temp RENAME TO orders_y2017_m3;
> ALTER TABLE orders_y2017_m3 INHERIT orders;
> COMMIT;
>
> but bloat returns again and again

Some bloat is to be expected unless you've totally static data due to the postgres MVCC model.

Are you saying vacuum full and cluster aren't removing the bloat?  Sounds unlikely to me.


Issues only arise when you can't manage it; from what you've posted we can see autovacuum is running, but perhaps it's
notkeeping up with your workload, or your update patterns make it difficult to keep bloat down; we can see some
rollbackswhich I'm sure are part of your problem. 

You could try updating to the latest minor version of postgres as there are a few fixes to autovacuum in versions after
9.5.3,but I think analyzing your update patterns and/or tuning autovacuum will be your starting point. 


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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Re: [GENERAL] UPDATE ... ON CONFLICT DO NOTHING
Следующее
От: Alexander Farber
Дата:
Сообщение: Re: [GENERAL] UPDATE ... ON CONFLICT DO NOTHING