shulkae wrote:
I am writing a shell script which runs as a cron entry. The objective
is to delete older records from postgresql DB.
I have thousands of records. What is the optimum number of records to
delete in one delete command
as many as you need to,
DELETE FROM yourtable AS t
WHERE CURRENT_DATE - t.recorddate < INTERVAL '90 days';
or whatever. pooof, all records over that given parameter are deleted,
about as efficiently as can be. of course, as always, the space
doesn't get reclaimed until that table is vacuumed.
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general