Re: No heap lookups on index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: No heap lookups on index
Дата
Msg-id 4101.1137626851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: No heap lookups on index  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: No heap lookups on index  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> You might want to consider the thought of "organised heaps" as an
> alternative thought to index improvements. That way there is no heap to
> avoid visiting because the index is also the main data structure.
> This would offer performance, but would be one of the largest patches
> seen in recent times. You may find some co-backers.

Either way it would be a pretty monstrous patch :-( ... in this case
because of the amount of code that knows about the properties of heap
storage, and in what David is thinking about because of the implications
of trying to keep multiple copies of tuple state up-to-date.

We'd probably end up with a cleaner system structure if we tried to
create an API separating out the knowledge of heap structure, but the
amount of work needed seems out of proportion to the benefit.

It might be possible to compromise though.  Imagine an index that
contains only the upper levels of a search tree --- links to what
would be the leaf level point into the associated heap.  In this design
the heap is still a heap in the sense that you can seqscan it without
any awareness of the index structure.  What you can't do is insert
tuples or move them around without the index AM's say-so.
RelationGetBufferForTuple would become an index AM call, but otherwise
I think the impact on existing code wouldn't be large.

There are some limitations.  For instance I don't think that the index
AM could control the order of items within a heap page, because of the
need for TIDs to be persistent; so within-page searches would still be
kinda slow.  But it's interesting to think about.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgxs/windows
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Surrogate keys (Was: enums)