Re: [HACKERS] Predicate Locks for writes?

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: [HACKERS] Predicate Locks for writes?
Дата
Msg-id CAPpHfdsJ41UdHvk1f6J7XBV6rcexLdUairujmMt9JNxQgk7gsQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Predicate Locks for writes?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Oct 11, 2017 at 7:27 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Wed, Oct 11, 2017 at 11:51 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> I'm inclined to believe Robert's hypothesis that there is some race
> condition there.
>
> The question is whether that still constitutes a serializability
> problem since we haven't done anything with the data, just passed it
> upwards to be modified.

Well, the question is whether passing it upwards constitutes reading
it.  I kind of suspect it does.  The plan tree isn't just blindly
propagating values upward but stuff with them.  There could be quite a
bit between the ModifyTable node and the underlying scan if DELETE ..
FROM or UPDATE .. USING is in use.

Right.  In general we can't skip SIReadLock just basing on the fact that we're under ModifyTable node.
It seems still possible for me to skip SIReadLock in some very limited (but probably typical) cases.
But before analyzing this deeper, it would be nice to estimate possible benefits.  
We can try some broken version which skip all SIReadLock's under ModifyTable node and benchmark it.
If it wouldn't have significant performance benefit, then there is no reason to do something further...

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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] pgsql: Avoid coercing a whole-row variable that is already coerced