Create a cron job that deactivates old records in order to optimize performance. Records are deactivated based on their last activity (write_date).