Re: CASCADE/fkey order

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: CASCADE/fkey order
Дата
Msg-id CAKFQuwbZma4+i43RZDxJHi7uay14WNditYJ4Jf3vjTM5zAYJ_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CASCADE/fkey order  (Samuel Nelson <valczir.darkvein@gmail.com>)
Список pgsql-general
On Wed, Jul 22, 2020 at 9:03 AM Samuel Nelson <valczir.darkvein@gmail.com> wrote:
seems to fix it to work as we were expecting.  Is that particularly costly?  Should I only set the constraint to be deferred when we really need it?  Would it be more efficient to perform the deletes explicitly within a transaction rather than relying on the cascades and deferring that one constraint?

I don't know.  I tend to go with only deferring the check if the specific transaction requires it.  If there are no issues I would presume that checking at the end would be more efficient.  But if there are problems you could end up performing unnecessary work.  Memory consumption probably increases as well since constraint related information cannot be discarded as each command completes but must be kept around for the eventual validation.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Slow or Cannot Connect to PostgreSQL Instance Service on Windows 10
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: How to create function returning numeric from string containing percent character