Re: How to increase row deletion efficiency?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to increase row deletion efficiency?
Дата
Msg-id 29270.1133968316@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to increase row deletion efficiency?  (Alexander Stanier <alexander.stanier@egsgroup.com>)
Ответы Re: How to increase row deletion efficiency?  (Alexander Stanier <alexander.stanier@egsgroup.com>)
Список pgsql-sql
Alexander Stanier <alexander.stanier@egsgroup.com> writes:
> I am currently trying to separate two environments contained in one 
> database. Essentially I need to break that one database down into two 
> with a portion of the data going to each new database. I am intending to 
> achieve this by duplicating the database and then stripping out the data 
> that is not required in each database. I have started by trying to 
> delete data from a set of 28 related tables, however the performance 
> appears to be terrible. I am deleting from a table called document which 
> cascades down to 27 tables underneath it linked by various cascading 
> foreign key constraints. Some of these subsidiary tables have as many as 
> a couple of million records.

Do you have indexes on the referencing columns?  PG enforces an index on
the referenced column, but not on the other end, and DELETE is where it
will hurt if you haven't got one.
        regards, tom lane


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

Предыдущее
От: Alexander Stanier
Дата:
Сообщение: How to increase row deletion efficiency?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: constrains problem...