Re: Problem Deleting Referenced records

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Problem Deleting Referenced records
Дата
Msg-id 20031111190246.GB11772@wolff.to
обсуждение исходный текст
Ответ на Re: Problem Deleting Referenced records  (Alex <alex@meerkatsoft.com>)
Список pgsql-general
On Wed, Nov 12, 2003 at 00:08:02 +0900,
  Alex <alex@meerkatsoft.com> wrote:
> Bruno,
> I am not sure why but the whole delete proces with the where not exists
> method took 3hrs, rather long I would say.
>
> Table A had 2.5mil records
> Table B had about 30k records
>
> In addition  Table C with about 2 mil records referenced a  referenced A
> (same key as B)
> In both A and B about 150k records where deleted... but the process took
> more than 3 hrs.
>
> Its pretty long I would say. I noticed in the past that if I had
> multiple foreign keys, referencing different tables like TableA <--
> TableB <-- TableC then deletes are really slow... sometimes in the area
> of one delete per second. Never really figured out why. (And yes I did
> run a Vacuum or Vacuum analyze on the DB
> or Tables).

If you do a lot of deleting of rows in referenced tables, then you probably
want to create indexes in the referencing tables for the key. This will
allow for quicker checks by the referential integrity checking triggers.

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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: [ANNOUNCE] PostgreSQL v7.4 Release Candidate 2
Следующее
От: "mboscia"
Дата:
Сообщение: change conndeferrable in pg_constraint?