Re: Fix FK deadlock, but no magic please

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Fix FK deadlock, but no magic please
Дата
Msg-id 20030116154144.Q10566-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: Fix FK deadlock, but no magic please  (Jon Swinth <jswinth@atomicpc.com>)
Ответы Re: Fix FK deadlock, but no magic please  (Jon Swinth <jswinth@atomicpc.com>)
Список pgsql-general
On Thu, 16 Jan 2003, Jon Swinth wrote:

> Now I understand what you are trying to say, but what you are describing is
> normal (happens in most DBs) and rather uncommon (in my experience).  General
> DB design is done so reference tables end up with a lot of read locks and
> rarely have a write lock.  It would be cool if you could remove that
> contention, but not at the expense of expected write lock behaivor.

I think I may have also misunderstood which lock behavior you were worried
about.  In either scheme if someone does something like:

Transaction 1: begin;
Transaction 2: begin;
Transaction 1: select for update from pk where key=1;
 - Gets a write lock on row with pk.key=1
   [Or does an update or a delete or whatever]
Transaction 2: insert into fk values (1);
 - Needs to wait on the write lock above

That will stay true even in the dirty read scheme.



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Fix FK deadlock, but no magic please
Следующее
От: Justin Clift
Дата:
Сообщение: Translation of the PostgreSQL manuals to Spanish is under way