I have a postgresql database with 100 GB size. One of the tables has about half a billion entries. For quick data entry, some of the data was repeated and left to be pruned later. One of the columns can be used to identify the rows as unique.
I found this stackoverflow question which suggested a solution for mysql:
ALTER IGNORE TABLE table_name ADD UNIQUE (location_id, datetime)
Is there anything similar for postgresql?
I tried deleting with group by and row number, my computer runs out of memory after a few hours in both cases.
This is what I get when I try to estimate the number of rows in the table:
SELECT reltuples FROM pg_class WHERE relname = 'orders';
reltuples
-------------
4.38543e+08
(1 row)