Re: NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints
Дата
Msg-id 23474.1391715962@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
Jeff Janes <jeff.janes@gmail.com> writes:
> I've been plagued several times by NOT DEFERRABLE constraints.  Is there
> any good reason to define a constraint as NOT DEFERRABLE rather
> than DEFERRABLE INITIALLY IMMEDIATE?  For example, is there performance
> penalty for PostgreSQL being prepared to defer a constraint even though it
> is not currently being deferred?

There's a substantial performance difference between deferrable and
nondeferrable uniqueness constraints (ie, indexes).  For foreign keys
I don't believe it matters.  We don't implement deferrability for
other types of constraints such as CHECK.

            regards, tom lane


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Offending My Tender Sensibilities -OR- OLTP on a Star Schema