Re: Delete operation VERY slow...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Delete operation VERY slow...
Дата
Msg-id 16186.1150464632@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Delete operation VERY slow...  (David Leangen <postgres@leangen.net>)
Список pgsql-performance
David Leangen <postgres@leangen.net> writes:
> The only inconvenience is that I need to remove all the foreign key
> constraints before truncating, then put them back after.

I was about to ask if you had any.  Usually the reason for DELETE being
slow is that you have foreign key references to (not from) the table and
the referencing columns aren't indexed.  This forces a seqscan search
of the referencing table for each row deleted :-(

            regards, tom lane

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Optimizer internals
Следующее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Optimizer internals