Re: Need an idea to operate massive delete operation on big size table. - Mailing list pgsql-admin

From Alex Balashov
Subject Re: Need an idea to operate massive delete operation on big size table.
Date
Msg-id F2F9DB44-8DBA-4606-A570-1C12C588A7BC@evaristesys.com
Whole thread Raw
In response to Re: Need an idea to operate massive delete operation on big size table.  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Need an idea to operate massive delete operation on big size table.
List pgsql-admin
In my experience, mass deletions are tough. There may be a supporting index to assist the broadest criteria, but the
filteredrows that result must still be sequentially scanned for non-indexed sub-criteria[1]. That can still be an awful
lotof rows and a huge, time-consuming workload.  

While it won't help with deduplication, partitioning is a very good, if somewhat labour-intensive solution to the
problemof aging old data off the back of a rolling archive. Once upon a time, I had an installation with a periodic
hygienic`DELETE` once or twice a year, which took many hours to plan and execute, and placed considerable demand on the
system.We switched to monthly partitioning and the result was, to some, indistinguishable from magic.  

-- Alex

[1] Which normally doesn't make sense to index, in the overall tradeoff of index size and maintenance overhead vs.
performancepayoff. 

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800




pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Need an idea to operate massive delete operation on big size table.
Next
From: Rajesh Kumar
Date:
Subject: Re: Move datapath