[HACKERS] Predicate Locks for writes?

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема [HACKERS] Predicate Locks for writes?
Дата
Msg-id CANP8+jJ4LQdWH9T-qTA2J1k8ermuxiPaza7uE9tKvHQeTLtS0w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] Predicate Locks for writes?  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: [HACKERS] Predicate Locks for writes?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
SERIALIZABLE looks for chains of rw cases.

When we perform UPDATEs and DELETEs we search for rows and then modify
them. The current implementation views that as a read followed by a
write because we issue PredicateLockTuple() during the index fetch.

Is it correct that a statement that only changes data will add
predicate locks for the rows that it modifies?

PredicateLockTuple() specifically avoids adding an SIRead lock if the
tuple already has a write lock on it, so surely it must also be
correct to skip the SIRead lock if we are just about to update the
row?

I am suggesting that we ignore PredicateLockTuple() for cases where we
are about to update or delete the found tuple.

ISTM that a Before Row Trigger would need to add an SIRead lock since
that is clearly a read.

Thoughts?

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Andreas Seltenreich
Дата:
Сообщение: Re: [HACKERS] parallel worker (PID ) exited with exit code 1
Следующее
От: amul sul
Дата:
Сообщение: Re: [HACKERS] [POC] hash partitioning