Re: Help with large delete

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Help with large delete
Дата
Msg-id 1939729.1650123237@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Help with large delete  (Perry Smith <pedz@easesoftware.com>)
Ответы Re: ***SPAM*** Re: Help with large delete  (Perry Smith <pedz@easesoftware.com>)
Re: Help with large delete  (Perry Smith <pedz@easesoftware.com>)
Список pgsql-general
Perry Smith <pedz@easesoftware.com> writes:
> Currently I have one table that mimics a file system.  Each entry has a parent_id and a base name where parent_id is
anid in the table that must exist in the table or be null with cascade on delete. 
> I’ve started a delete of a root entry with about 300,000 descendants.  The table currently has about 22M entries and
I’madding about 1600 entries per minute still.  Eventually there will not be massive amounts of entries being added and
thetable will be mostly static. 

The most obvious question is do you have an index on the referencing
column.  PG doesn't require one to exist to create an FK; but if you
don't, deletes of referenced rows had better be uninteresting to you
performance-wise, because each one will cause a seqscan.

            regards, tom lane



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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Help with large delete
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Require details that can we see the password history to a User account in PostgreSQL Database.