Re: WIP: Access method extendability

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: WIP: Access method extendability
Дата
Msg-id CAPpHfdu=EYSo=jzzN+dOWHhekhJbbyMKLETYby_RFwBe9q6dTQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: Access method extendability  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: WIP: Access method extendability  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
Hackers,

there is next revision of patches providing access method extendability.
Now it's based on another patch which reworks access method interface.
http://www.postgresql.org/message-id/CAPpHfdsXwZmojm6Dx+TJnpYk27kT4o7Ri6X_4OSWcByu1Rm+VA@mail.gmail.com

Besides access method interface, major change is generic xlog interface. Now, generic xlog interface is more user friendly. Generic xlog compares initial and changed versions of page by itself. The only thing it can't do is to find data moves inside page, because it would be too high overhead. So in order to get compact WAL records one should use GenericXLogMemmove(dst, src, size) in order to move data inside page. If this function wasn't used then WAL records would just not so compact.

In general pattern of generic WAL usage is following.

1) Start using generic WAL: specify relation

GenericXLogStart(index);

2) Register buffers

GenericXLogRegister(0, buffer1, false);
GenericXLogRegister(1, buffer2, true);

first argument is a slot number, second is the buffer, third is flag indicating new buffer

3) Do changes in the pages. Use GenericXLogMemmove() if needed.

4) Finish using GenericXLogFinish(), or abort using GenericXLogAbort(). In the case of abort initial state of pages will be reverted.

Generic xlog takes care about critical section, unlogged relation, setting lsn, making buffer dirty. User code is just simple and clear.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_upgrade + Extensions
Следующее
От: Alvaro Herrera
Дата:
Сообщение: On columnar storage (2)