Re: [RFC] Minmax indexes

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: [RFC] Minmax indexes
Дата
Msg-id 20130617203143.GA3390@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: [RFC] Minmax indexes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 2013-06-17 16:23:40 -0400, Alvaro Herrera wrote:
> > > Re-summarization is relatively expensive, because the complete page range has
> > > to be scanned.
> > 
> > Why?  Why can't we just update the affected pages in the index?
> 
> The page range has to be scanned in order to find out the min/max values
> for the indexed columns on the range; and then, with these data, update
> the index.

Why? Assuming the initial summarization has been performed you can check
the current min/max value, check whether it's still smaller/bigger than
the value you're inserting and if not update the index accordingly with
the new value. You don't even need to wait for the new value to become
visible since the ranges don't need to be minimal.

I think the contention this possibly causes may a better argument, but I
am not sure how much of a problem that really becomes if we find a
deadlock free way to only lock the minmax pages exlusively if the range
is violated.

Greetings,

Andres Freund

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



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [RFC] Minmax indexes
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [RFC] Minmax indexes