Kyle Mahan Kyle Mahan on kylewm.com:
In case you were wondering why woodwind.xyz and silo.pub were down for ages, the database had finally filled up the disk. I eventually willed myself out of entropy and wrote a cron job to delete entries older than a year (or more than 2000th in their feed, from e.g. twitter-atom)
DELETE FROM entry
USING (
SELECT
id,
ROW_NUMBER() OVER (PARTITION BY feed_id ORDER BY retrieved DESC) AS row
FROM entry
) AS numbered
WHERE entry.id = numbered.id
AND (row > 2000 OR retrieved < CURRENT_DATE - INTERVAL '365 days');

Typical silos, deleting users’ stuff without warning! ;]