Added indexes to the database. Was too slow on EC2.