Re: Refactoring of heapam code.

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: Refactoring of heapam code.
Дата
Msg-id CABOikdPFLGPhLpfgeRWNr8L4O6ziVi8=Mv--FQ0VHLj4yZpm0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Refactoring of heapam code.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Ответы Re: Refactoring of heapam code.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Список pgsql-hackers


On Mon, Aug 8, 2016 at 3:13 PM, Anastasia Lubennikova <a.lubennikova@postgrespro.ru> wrote:


Thank you for the review, I'll fix these problems in final version.

Posting the first message I intended to raise the discussion. Patches
were attached mainly to illustrate the problem and to be more concrete.

I started looking at the first patch posted above, but it seems you'll rewrite these patches after discussion on the heapam refactoring ideas you posted here https://wiki.postgresql.org/wiki/HeapamRefactoring concludes.

Some comments anyways on the first patch:

1. It does not apply cleanly with git-apply - many white space errors
2. I don't understand the difference between PageGetItemHeapHeaderOnly() and PageGetItemHeap(). They seem to do exactly the same thing and can be used interchangeably.
3. While I like the idea of using separate interfaces to get heap/index tuple from a page, may be they can internally use a common interface instead of duplicating what PageGetItem() does already.
4. Should we rename PageGetItemHeap() to PageGetHeapTuple() or something like that?
5. If we do this, we should probably have corresponding wrapper functions/macros for remaining callers of PageGetItem()

I also looked at the refactoring design doc. Looks like a fine approach to me, but the API will need much more elaborate discussions. I am not sure if the interfaces as presented are enough to support everything that even heapam can do today. And much more thoughts will be required to ensure we don't miss out things that new primary access method may need.

A few points regarding how the proposed API maps to heapam:

- How do we support parallel scans on heap?
- Does the primary AM need to support locking of rows?
- Would there be separate API to interpret the PAM tuple itself? (something that htup_details.h does today). It seems natural that every PAM will have its own interpretation of tuple structure and we would like to hide that inside PAM implementation.
- There are many upper modules that need access to system attributes (xmin, xmax for starters). How do you plan to handle that? You think we can provide enough abstraction so that the callers don't need to know the tuple structures of individual PAM?

I don't know what to do with the CF entry itself. I could change the status to "waiting on author" but then the design draft may not get enough attention. So I'm leaving it in the current state for others to look at.

Thanks,
Pavan

--
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: IF (NOT) EXISTS in psql-completion
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: patch: function xmltable