hard20 pts · first answer countsdatabasespostgresqlperformance
Deleting old log rows every night
A nightly `DELETE FROM api_logs WHERE created_at < now() - interval '90 days'` removes 30 million rows, takes hours and bloats the table. What is a better design?
Discussion 0
Join free to post in the discussion.
Related questions
- Slow email during signupBackend Developer
- What EXPLAIN tells youBackend Developer
- Asking for only a few fieldsBackend Developer
- Building a long string in a loopBackend Developer
- Building SQL from user inputBackend Developer
- What atomicity guaranteesBackend Developer
- WHERE column = NULL finds nothingBackend Developer
- COUNT(*) versus COUNT(column)Backend Developer