On Fri, Mar 27, 2020 at 08:41:04AM -0600, Michael Lewis wrote: > 2) If you are deleting/moving most of the table (91 of 150 million), > consider moving only the records you are keeping to a new table, renaming > old table, and renaming new table back to original name. Then you can do > what you want to shift the data in the old table and delete it. You could also make the old table a child of (inherit from) the new table. That allows you to remove rows separately from removing them. Partitioning (with legacy inheritence or the new, integrated way available in postgres 10) allows DROPing oldest tables rather than DELETEing from one gigantic table. You should consider somehow cleaning up the old table after you DELETE from it, maybe using vacuum full (which requires a long exclusive lock) or pg_repack (which briefly acquires an exclusive lock). -- Justin