Re: Effects of dropping a large table

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Effects of dropping a large table
Date: 2023-07-19 23:33:31
Message-ID: c9fea9c6-807c-474f-d698-968d3ac2a901@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/19/23 17:15, David Rowley wrote:
> On Wed, 19 Jul 2023 at 07:41, Rob Sargent<robjsargent(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amn Ojee Uw 2023-07-20 00:36:27 Nu-B here
Previous Message David Rowley 2023-07-19 23:15:58 Re: Effects of dropping a large table