Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfn6i-0002Zx-3S for pgsql-general@arkaria.postgresql.org; Sat, 16 Apr 2022 18:25:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfn5i-0005Om-Vx for pgsql-general@arkaria.postgresql.org; Sat, 16 Apr 2022 18:24:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfn5i-0005ON-Eo for pgsql-general@lists.postgresql.org; Sat, 16 Apr 2022 18:24:14 +0000 Received: from dormouse.elm.relay.mailchannels.net ([23.83.212.50]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfn5f-0002Np-OB for pgsql-general@postgresql.org; Sat, 16 Apr 2022 18:24:13 +0000 X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2A1B3C0A0B for ; Sat, 16 Apr 2022 18:24:10 +0000 (UTC) Received: from mi3-ss4.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 3BA1EC0E7B for ; Sat, 16 Apr 2022 18:24:09 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1650133449; a=rsa-sha256; cv=none; b=Evr5yWxFn1cJM5mNTA5lsHa/LAPcTCV73n1uoEfMvg41f5jekPEptcCSyF4BPl6V2wo9/S y9PxDKJQbZ+TdF9JwlJYuUrGauwPce0iSIEvCngE0rIrlwdSPvOtoxcpbjkDbQ8rjpeSXv y4pdQqVFv8pMoIbcbC8mmUfIPONwj880FZkHJLhyBMxSDPBco0mrHR5udFWooOK4mrFw5q WMYc2d4f2VosJqsjfqH6nhMmBmatxk1cVusy9Z3f8CdVqezmo67ZHUHbKhmqpg95m6Y5lm ZxMA+IgFjkPndjSzcLUvRX01NC+tob/F6mPC23Dm0eQlqtt68nFmzE3/RpotWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1650133449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4858vqQw5A2alsWy0nnvZ0cBeSk7pj9IVcb9WnETQP0=; b=NIN+lTBi2fdzR5y/eIGU0pum41VaXn+XQwK/Z63GYnmt/QZ2A6XyT+S8mhXqHdcckbHn6B 0T+aZvadgjSoT5/fo0Zjltzik6Rr6MD25HSKM3Kivsq7xWXq7TsWI+Ejjz3BSQdaDPbevh bGH4WrVAn+yB3wUWREJx+QqdUMBsQcpoLJYveIs3D8tV4JQ4hgt7LtIIeJsA/M9iQE6yxS wW1KQUMphqXT1rm4ebNb71voFoUdqsYB3ra12suS1cZorsnL5e3MqnT4RvAu9mqji2DrIi SjiNWq1y5PxgchGb5f00/eaZvfq1R5xHXHNjbpl/rI1AR1IeIQ2BhWMXDojfIQ== ARC-Authentication-Results: i=1; rspamd-b69d6888c-lfxcw; auth=pass smtp.auth=a2hosting smtp.mailfrom=pedz@easesoftware.com X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Received: from mi3-ss4.a2hosting.com (mi3-ss4.a2hosting.com [68.66.200.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.115.45.25 (trex/6.7.1); Sat, 16 Apr 2022 18:24:09 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com X-MailChannels-Auth-Id: a2hosting X-Eyes-Absorbed: 72b55ea152dfe56c_1650133449769_2375896449 X-MC-Loop-Signature: 1650133449769:226717079 X-MC-Ingress-Time: 1650133449768 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=easesoftware.com; s=default; h=Message-Id:In-Reply-To:To:References:Date: Subject:Mime-Version:Content-Type:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gjTljbDRcsnkFiPOx94PdthPs7dBweLb+8yOnoCvhYk=; b=RgRx+qzVAft4UtlBD3LVZTvdbu SYOVpon5dOHFoi3emqxI3puPE4UPUVgIU6aDCAhTdmI4RkZUageVRh5teh7T1QKx637BUsM5cqTJb fwnVEvLZ5tsMFtfOVfRhXbiNZDb1yq7cmO63u4vvYvKrDkw38yDMcgw82in8Hbqz+3FPif3dGYpjQ Zh6r7TxtDHw63n9ycm7UFRd9CuPWifBZJ69BTNGmNG+D4tPEz3sM4FV/ca5ukEDUQJ8XmLUnsabli 7/ov53Lel2efEHOa3UiHmvzim3DurY85ULEP73kO+8u5Lh5vdbiJpVDjOmMbyhsTFzLQUZhu/pBlY +DoZhxSg==; Received: from cpe-70-94-128-193.satx.res.rr.com ([70.94.128.193]:55836 helo=smtpclient.apple) by mi3-ss4.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nfn5c-0007R5-BJ for pgsql-general@postgresql.org; Sat, 16 Apr 2022 14:24:08 -0400 From: Perry Smith Content-Type: multipart/signed; boundary="Apple-Mail=_1D07D5AA-1B9C-4C27-A9CC-D51A78F75FE9"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: Help with large delete Date: Sat, 16 Apr 2022 13:24:07 -0500 References: <3823FD54-2910-41E5-B908-869DA917DE82@easesoftware.com> To: "pgsql-general@postgresql.org" In-Reply-To: Message-Id: <1BE8F4F8-5A34-40A0-9FC4-138BA91C00AD@easesoftware.com> X-Mailer: Apple Mail (2.3696.80.82.1.1) X-AuthUser: pedz+easesoftware.com@mi3-ss4.a2hosting.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_1D07D5AA-1B9C-4C27-A9CC-D51A78F75FE9 Content-Type: multipart/alternative; boundary="Apple-Mail=_C2F0524E-B17F-4A3E-8DA8-FD842A1EA827" --Apple-Mail=_C2F0524E-B17F-4A3E-8DA8-FD842A1EA827 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 16, 2022, at 12:57, Jan Wieck wrote: >=20 > Make your connection immune to disconnects by using something like the = screen utility. Exactly=E2=80=A6 I=E2=80=99m using emacs in a server (daemon) mode so it = stays alive. Then I do =E2=80=9Cshell=E2=80=9D within it. > On Sat, Apr 16, 2022, 09:26 Perry Smith > wrote: > 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. >=20 > I=E2=80=99ve started a delete of a root entry with about 300,000 = descendants. The table currently has about 22M entries and I=E2=80=99m = 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. >=20 > 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.=CB=98 >=20 > 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 =E2=80=94 its a long = story that isn=E2=80=99t really pertinent. The point is that @#$% = happens. >=20 > =E2=80=9CWhat can I do=E2=80=9D includes starting completely over if = necessary. I=E2=80=99ve 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. >=20 > Thank you for your time, > Perry >=20 --Apple-Mail=_C2F0524E-B17F-4A3E-8DA8-FD842A1EA827 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Apr 16, 2022, at 12:57, Jan Wieck <jan@wi3ck.info> = wrote:

Make your connection immune to disconnects by = using something like the screen = utility.

Exactly=E2=80=A6= I=E2=80=99m using emacs in a server (daemon) mode so it stays alive. =  Then I do =E2=80=9Cshell=E2=80=9D within it.


On Sat, Apr 16, 2022, 09:26 Perry Smith <pedz@easesoftware.com> wrote:
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=E2=80=99ve started a delete of a root entry with about 300,000 = descendants.  The table currently has about 22M entries and I=E2=80=99= 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.=CB=98

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 =E2=80=94 its a = long story that isn=E2=80=99t really pertinent.  The point is that = @#$% happens.

=E2=80=9CWhat can I do=E2=80=9D includes starting completely over if = necessary.  I=E2=80=99ve 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


= --Apple-Mail=_C2F0524E-B17F-4A3E-8DA8-FD842A1EA827-- --Apple-Mail=_1D07D5AA-1B9C-4C27-A9CC-D51A78F75FE9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5yOa/gCtQpb3oCpljxzk9yzE+MAFAmJbCccACgkQjxzk9yzE +MBztRAAsvSnYXC24UeuDwBrXnP6AfW8MTJT67q/1BQcrknbpHPUUy5d33pFoTtZ 64myYBuqKS7Tw+qm7fr7W0XId3EFuOudip/p/wRtpizLVEonm5CN3higzj+ETnus yUweh4Q/mnX7c37gmbID9U0xsgaVJBQaD1y6vvHPdpMfXZAjBgnhBSh8saK7NGXi 3RXguNjHXA/+p9OCRSSQ/kI23OhqQaf8Gne1e/nTSNoQre/1i3NPV78VWxaWbnFh G7FQurB0PjoTZroqp6fQphQbYWcJ3wA+NdzTooMyOg/t0wk5WP90OEeKNrSe8rXT o4L8Q/eQcFDmv0kMiDlrwJOMHDP2W2CduJZ/QDYR8OeOipTOqtPOpXmsGCTdsmPQ MbePx0GAY7WI8HjlQU54/r23fj+b6Z8j+0ZhTEB1iMNz4RgrtHL0vgdjif3lCGxz danoKx9QHsstBC8nOKhAAbAUA1vmlOzL9ey6P01FtkLgk87Z5tJe5F5DJ7SSFtDe s9i6efNQUNX5YcI4YTFg+ErElbN3IXEPNY76/FqunILpf+VpcUXeJaU/wm15/W3k iQJGRhZeHD0GrEwdq+qycp6CUYHNhivwqaZpJe9wv36i8RssEOC5Ssxt2yOxcY+H dV5aimPN/Fiu/N+myOsFqeQfkqOE1VDWT1b3hqCJFErZV0RwOIg= =P7U8 -----END PGP SIGNATURE----- --Apple-Mail=_1D07D5AA-1B9C-4C27-A9CC-D51A78F75FE9--