maintenance.sql 742 Bytes
Newer Older
chove's avatar
chove committed
1 2 3 4 5
-----------------------------------------------------------------
-- Maintenance de la base pgsql sur rouge, lancé par cron
-----------------------------------------------------------------

-- effacement des vieux enregistrements
6
DELETE FROM upload where date< timestamp 'now' - interval '2 days';
7 8
-- On ne blackliste plus pour virus, on droppe seulement
-- DELETE FROM virus where date< timestamp 'now' - interval '2 days';
9 10
DELETE FROM flood where date< timestamp 'now' - interval '2 days';
DELETE FROM p2p where date< timestamp 'now' - interval '2 days';
chove's avatar
chove committed
11 12

-- suppression complète des entrées
13
VACUUM;
chove's avatar
chove committed
14 15 16 17 18 19

-- réindexation des tables
REINDEX TABLE upload;
REINDEX TABLE virus;
-- REINDEX TABLE flood; -- flood n'a pas d'index
REINDEX TABLE p2p;