MultiXact pessmization in 9.3

Поиск
Список
Период
Сортировка
От Andres Freund
Тема MultiXact pessmization in 9.3
Дата
Msg-id 20131121200517.GM7240@alap2.anarazel.de
обсуждение исходный текст
Ответы Re: MultiXact pessmization in 9.3  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

While looking at the multixact truncation code (mail nearby), I've
noticed that there's a significant difference in the way multixact
members are accessed since fkey locks were introduced:

<9.3 when heap_lock_tuple finds a XMAX_IS_MULTI tuple it executes
MultiXactIdWait() which in turn uses GetMultiXactIdMembers() to get the
xids to wait for. But it skips the lookup if the mxid we lookup is older
than OldestVisibleMXactId.

9.3+ instead always looks up the members because GetMultiXactIdMembers()
is also used in cases where we need to access old xids (to check whether
members have commited in non-key updates). I've seen several profiles -
independent from this investigation - where GetMultiXactIdMembers() is
high up in the profiles. So this seems to be a significant
pessimization.
I think we need to re-introduce that optimization for the - hopefully
very common - case of LOCK_ONLY multixacts.

The file header's comment about OldestVisibleMXactId[] seems to be
out-of-date btw, since it's now perfectly normal to access mxids that
are older than what MultiXactIdSetOldestVisible() computed.

Maybe I am just missing something?

Greetings,

Andres Freund

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



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add \i option to bring in the specified file as a quoted literal
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: new unicode table border styles for psql