The only scalable delete in Postgres is DROP TABLE
Blog post from PlanetScale
Deleting data in PostgreSQL can be resource-intensive, especially at large scales, due to the way the database manages row versions and space. Large DELETE operations do not immediately free disk space and add additional load due to the need for replication and maintaining multiple row versions through Multi-Version Concurrency Control (MVCC). This can lead to increased work for read queries and autovacuum processes. In contrast, DROP TABLE and TRUNCATE operations are more efficient for large data deletions as they remove data files directly from the operating system, freeing up space immediately, and do not generate dead tuples or vacuum debt. For scenarios where a large amount of data must be deleted, restructuring the database schema to allow for DROP TABLE or TRUNCATE instead of DELETE can greatly enhance performance and scalability. This can be particularly useful in cases of schema designs utilizing partitioning, which allows for efficient data management by converting frequent DELETE operations into occasional DROP TABLE operations. Additionally, employing a trigger-based approach or pg_squeeze for large-scale data deletions can further optimize database performance by preventing bloat and reducing replication lag.