From: Perry Smith <pedz@easesoftware.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Help with large delete
Date: Sat, 16 Apr 2022 08:25:56 -0500
Message-ID: <3823FD54-2910-41E5-B908-869DA917DE82@easesoftware.com> (raw)
Currently I have one table that mimics a file system. Each entry has a parent_id and a base name where parent_id is an id 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’m adding about 1600 entries per minute still. Eventually there will not be massive amounts of entries being added and the table will be mostly static.
I started the delete before from a terminal that got detached. So I killed that process and started it up again from a terminal less likely to get detached.˘
My question is basically how can I make life easier for Postgres? I believe (hope) the deletes will be few and far between but they will happen from time to time. In this case, Dropbox — its a long story that isn’t really pertinent. The point is that @#$% happens.
“What can I do” includes starting completely over if necessary. I’ve only got about a week invested in this and its just machine time at zero cost. I could stop the other processes that are adding entries and let the delete finish if that would help. etc.
Thank you for your time,
Perry
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pedz@easesoftware.com
Subject: Re: Help with large delete
In-Reply-To: <3823FD54-2910-41E5-B908-869DA917DE82@easesoftware.com>
References: <3823FD54-2910-41E5-B908-869DA917DE82@easesoftware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox