Updating access timestamps without wrecking the database
When you want to know the last time some user was seen or some resource was accessed/viewed, then usually you reach to a timestamp column and update this to the current time whenever it’s seen or accessed. You may have written this kind of SQL statement (or the equivalent) in your ORM yourself a few times: It looks innocent, but even on reasonably small tables, this can cause slow UPDATE statements regularly.