I am using postgree 9.4 database and I have a table snapshots
with 700+ million rows and I want to delete about 9 million rows. I have tried different queries to delete records, but no success.
Query to delete all records for a specific camera:
DELETE FROM snapshots where camera_id = 1248
Another query to delete recodes between snapshot_id
:
DELETE from snapshots where snapshot_id >= '1248_201511010000000' and <= '1248_20151130235959000'
Suggest me what will be the fastest way of deleting records from 700+ millions records.
snapshots
table? Can you post an EXPLAIN ANALYZE of a slow DELETE?