Re: FKs and deadlocks

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: FKs and deadlocks
Дата
Msg-id 20041022062521.C1352@megazone.bigpanda.com
обсуждение исходный текст
Ответ на FKs and deadlocks  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Ответы Re: FKs and deadlocks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, 22 Oct 2004, Philippe Lang wrote:

> I have tried to correct that by adding a "SET CONSTRAINTS ALL DEFERRED"
> in every trigger and function, hoping it would solve my problem. Maybe
> it helped, but it did not solve anything.

Note that set constraints all deferred does nothing unless you made the
constraint deferrable which is not the default.  If your constraints
aren't then you won't see any effect, and you'll probably want to change
them and see if that does help (and possibly making them initially
deferred at the same time).

> I don't know if anyone has a better idea, but I would like to try taking
> away some FKs in my schema. My problem is that I really don't know which
> one to delete. There are over 40 tables. Are there rules to do that? Or
> maybe can I simply wait on the next deadlock, and try understanding who
> got locked by who? OK, but how can I do that?

I think you may be able to do this if you turn on statement locking and
try to resurrect the state from the logs.  If you want to send a possibly
slightly sanitized typical sequence of events, we might be able to help
with that part.

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

Предыдущее
От: "Ruediger Herrmann"
Дата:
Сообщение: Re: Row versioning
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: table size/record limit