Re: on update / on delete performance of foreign keys

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: on update / on delete performance of foreign keys
Дата
Msg-id 41F4FD14.1040401@archonet.com
обсуждение исходный текст
Ответ на on update / on delete performance of foreign keys  ("Florian G. Pflug" <fgp@phlo.org>)
Ответы Re: on update / on delete performance of foreign keys  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-general
Florian G. Pflug wrote:
> Hi
>
> I ran into some performance problems regarding foreign keys lately.
> My schema has about 20 tables, which each contain from 10 to 100.000
> records. They have quite complicated interdependencies, modeled using
> foregin keys set to "on update cascade, on delete cascade".
> The schema stores data for multiple customers - Recently I wanted
> to extract the data for just a single customer. I duplicated the schema,
> and deleted all but one customer from the "customer" table. This worked
> as expected, but the delete took a few hours (!) on a moderatly fast
> machine (dual 1GHz PIII, RAID5-Array for postgres-data).

PostgreSQL doesn't automatically add indexes to foreign-key columns.
That sounds like the issue to me.

--
   Richard Huxton
   Archonet Ltd

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

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