pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Effects of dropping a large table
Date: Wed, 19 Jul 2023 17:33:31 -0600
Message-ID: <c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com> (raw)
In-Reply-To: <CAApHDvojNTFb=A1zE7oiz02JaHkp2f8q=C8SOd+QwvwJYV2cLQ@mail.gmail.com>
References: <CANi9rAN7vm7-+qAK6Sasa_S69y2OWZBqQ3Fksx3dMmRLBRDLBA@mail.gmail.com>
	<7e97caed-e625-867d-a4f9-8512c8db3421@gmail.com>
	<CAApHDvojNTFb=A1zE7oiz02JaHkp2f8q=C8SOd+QwvwJYV2cLQ@mail.gmail.com>

On 7/19/23 17:15, David Rowley wrote:
> On Wed, 19 Jul 2023 at 07:41, Rob Sargent<robjsargent@gmail.com>  wrote:
>> You might consider deleting portions of the table in separate (consecutive) batches (maybe 5% per delete).  And then truncate table is not logged so that might be an alternative.
> Can you explain why this would be a useful thing to do?
>
> It sounds to me like it would just create a load of needless WAL from
> the deletes and the vacuum that cleans up the dead rows each of which
> is more likely to cause lag problems on the replica servers, which the
> OP is trying to avoid.
>
> David
No, you're right.  I was remembering problems with _deleting_ 
essentially all of a large table (with limited resources).  The drop 
might not have the same problem.  But aren't they logged/transactional 
and then in the WALs anyway.

view thread (10+ messages)  latest in thread

Message-ID: <c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com>
Permalink:  ../c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com/
Also on:    postgresql.org/message-id/c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com

 · 

reply

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: robjsargent@gmail.com, dgrowleyml@gmail.com
  Subject: Re: Effects of dropping a large table
  In-Reply-To: <c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com>
  References: <CANi9rAN7vm7-+qAK6Sasa_S69y2OWZBqQ3Fksx3dMmRLBRDLBA@mail.gmail.com> <7e97caed-e625-867d-a4f9-8512c8db3421@gmail.com> <CAApHDvojNTFb=A1zE7oiz02JaHkp2f8q=C8SOd+QwvwJYV2cLQ@mail.gmail.com> <c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.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