Re: Delete query takes exorbitant amount of time

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Delete query takes exorbitant amount of time
Дата
Msg-id 3750.1111715318@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Delete query takes exorbitant amount of time  (Karim Nassar <Karim.Nassar@acm.org>)
Ответы Re: Delete query takes exorbitant amount of time  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: Delete query takes exorbitant amount of time  (Karim Nassar <karim.nassar@NAU.EDU>)
Список pgsql-performance
Karim Nassar <karim.nassar@NAU.EDU> writes:
>> Look at what your triggers are doing.  My private bet is that you have
>> unindexed foreign keys referencing this table, and so each deletion
>> forces a seqscan of some other, evidently very large, table(s).

> Almost. I have a large table (6.3 million rows) with a foreign key
> reference to this one (which has 749 rows), however it is indexed.

In that case there's a datatype mismatch between the referencing and
referenced columns, which prevents the index from being used for the
FK check.

            regards, tom lane

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

Предыдущее
От: Karim Nassar
Дата:
Сообщение: Re: Delete query takes exorbitant amount of time
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Delete query takes exorbitant amount of time