Clear empty space in a page.

Поиск
Список
Период
Сортировка
От Yura Sokolov
Тема Clear empty space in a page.
Дата
Msg-id 10c4c221489ea252149569a8431b13f8@postgrespro.ru
обсуждение исходный текст
Ответы Re: Clear empty space in a page.  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: Clear empty space in a page.  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Good day.

Long time ago I've been played with proprietary "compressed storage"
patch on heavily updated table, and found empty pages (ie cleaned by
vacuum) are not compressed enough.

When table is stress-updated, page for new row versions are allocated
in round-robin kind, therefore some 1GB segments contains almost
no live tuples. Vacuum removes dead tuples, but segments remains large
after compression (>400MB) as if they are still full.

After some investigation I found it is because PageRepairFragmentation,
PageIndex*Delete* don't clear space that just became empty therefore it
still contains garbage data. Clearing it with memset greatly increase
compression ratio: some compressed relation segments become 30-60MB just
after vacuum remove tuples in them.

While this result is not directly applied to stock PostgreSQL, I believe
page compression is important for full_page_writes with wal_compression
enabled. And probably when PostgreSQL is used on filesystem with
compression enabled (ZFS?).

Therefore I propose clearing page's empty space with zero in
PageRepairFragmentation, PageIndexMultiDelete, PageIndexTupleDelete and
PageIndexTupleDeleteNoCompact.

Sorry, didn't measure impact on raw performance yet.

regards,
Yura Sokolov aka funny_falcon
Вложения

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

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: security_definer_search_path GUC
Следующее
От: Thomas Munro
Дата:
Сообщение: O_DIRECT on macOS