Re: on update / on delete performance of foreign keys

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: on update / on delete performance of foreign keys
Дата
Msg-id 87wtu26gt1.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на on update / on delete performance of foreign keys  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-general
"Florian G. Pflug" <fgp@phlo.org> writes:

> when deleting a lot of rows from a large table - and each time it has to find
> referencing tuples by doing an index scan

Are you sure it was even an index scan? And not doing a sequential table scan
for every deletion? In order to do an index scan you need an index on foreign
key columns in the referencing tables, not just the referenced tables. Usually
people only think about the referenced tables because usually that's all they
need. Only when you start cascading updates and deletes do you need indexes on
the columns in the referencing tables.

--
greg

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: How are foreign key constraints built?
Следующее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: on update / on delete performance of foreign keys