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

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist
Дата
Msg-id b929d56e-1c1d-dd5a-e21b-1baf06f6bffe@iki.fi
обсуждение исходный текст
Ответ на Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Ответы Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin and sp-gist  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin andsp-gist  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Список pgsql-hackers
On 28/02/18 18:03, Anastasia Lubennikova wrote:
> Hi,
> 
> I want to propose a bunch of patches which allow to reduce WAL traffic
> generated by CREATE INDEX for GiST, GIN and SP-GiST. Similarly to b-tree
> and RUM, we can now log index pages of other access methods only once
> in the end of indexbuild process.

Makes sense. Is there any scenario where the current method is better? 
In theory, doing another pass through the whole index, to create the WAL 
records, requires more I/O. But in practice, it seems that the reduction 
in WAL is almost certainly a win.

> Implementation is based on generic_xlog.

Why? I think we should just add a log_relation() function in 
xloginsert.c directly, alongside log_newpage_buffer().

This makes the assumption that all the pages in these indexes used the 
standard page layout. I think that's a valid assumption, but needs at 
least a comment on that. And perhaps an Assert, to check that 
pd_lower/upper look sane.

As a further optimization, would it be a win to WAL-log multiple pages 
in each record?

This leaves the XLOG_*_CREATE_INDEX WAL record types unused, BTW.

- Heikki


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

Предыдущее
От: Simon Muller
Дата:
Сообщение: Re: Allow COPY's 'text' format to output a header
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Failure assertion in GROUPS mode of window function in current HEAD