insert or update on table "visits" violates foreign key
There is the following recurrent error in the logs:
[WRN] Problem incrementing visits: ERROR #23503 insert or update on table "visits" violates foreign key constraint "visits_book_id_fkey"
My guess is that is produced by visits to books that are not there anymore, o the book id doesn't match anything the DB. Will be nice to detect this situations in the code and don't try to produce visit stats in this case.