Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist

Поиск
Список
Период
Сортировка
От Andrey Lepikhov
Тема Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist
Дата
Msg-id e8371fe3-aefe-aa91-e87f-1602f9984fed@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers

On 25/03/2019 15:21, Heikki Linnakangas wrote:
> I had another quick look.
> 
> I still think using the "generic xlog AM" for this is a wrong level of 
> abstraction, and we should use the XLOG_FPI records for this directly. 
> We can extend XLOG_FPI so that it can store multiple pages in a single 
> record, if it doesn't already handle it.
> 
> Another counter-point to using the generic xlog record is that you're 
> currently doing unnecessary two memcpy's of all pages in the index, in 
> GenericXLogRegisterBuffer() and GenericXLogFinish(). That's not free.
> 
> I guess the generic_log_relation() function can stay where it is, but it 
> should use XLogRegisterBuffer() and XLogInsert() directly.

Patch set v.3 uses XLOG_FPI records directly.

As a benchmark I use the script (test.sql in attachment) which show WAL 
size increment during index build. In the table below you can see the 
influence of the patch on WAL growth.

Results
=======
AM    | master | patch |
GIN    | 347 MB | 66 MB |
GiST    | 157 MB | 43 MB |
SP-GiST | 119 MB | 38 MB |

-- 
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
The Russian Postgres Company

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: speeding up planning with partitions
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: Pluggable Storage - Andres's take