Re: Problem Deleting Referenced records

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Problem Deleting Referenced records
Дата
Msg-id 20031110145117.GA23136@wolff.to
обсуждение исходный текст
Ответ на Re: Problem Deleting Referenced records  (Alex <alex@meerkatsoft.com>)
Ответы Re: Problem Deleting Referenced records  (Alex <alex@meerkatsoft.com>)
Список pgsql-general
On Mon, Nov 10, 2003 at 16:20:21 +0900,
  Alex <alex@meerkatsoft.com> wrote:
> Bruno,
> thanks. I actually did it that way but having to join two tables each
> 1-2 million records makes this process rather time consuming.
> I was hoping that the ON DELETE options in the constraint could handle
> that.

If only a small number of the 1-2 million records have old dates, than the
where not exists method might be faster. An index scan could be used
to find the records with old dates and then for each record an index
lookup could be done in table B to see if it should really be deleted.

>
> It seems to be a bit odd that if I want to delete 100 records that are
> not related to each other, and one record deletion fails that then the
> entire delete process fails.

You can delete each record in its own transaction if you want that
behavior.

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

Предыдущее
От: "Philippe Lang"
Дата:
Сообщение: Dynamic expression evaluation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Dynamic expression evaluation