Title: High Performance PostgreSQL for Rails: Archiving mentions deleted_at column (p338)
The sql command DELETE FROM trip_positions WHERE created_at < (NOW() - INTERVAL ‘90 days’); has a where clause that references the column created_at. In the paragraph that describes the statement, the sentence “To make it fast, you may need an index covering the deleted_at column” should have referenced the created_at column. The trip_positions table do not use soft deletion in the example schema.
1 Like
Good catch @AndyGauge and thank you for reporting this. We’ll try and get a fix in place for the next ebook release version. I’ll leave this open until we’ve done that and I can comment on the fix and the version it will be part of.
Hi @AndyGauge. Hope your’e doing well! Thanks again for writing this up. I’ve just submitted a fix for this to correct the column name from deleted_at
which is incorrect, to created_at
, as you pointed out. This will hopefully make it into a future print of the book soon.