Change set_reachable/1 to an upsert
This code is in the hot path of every incoming activity. Reducing the need to SELECT before INSERT/UPDATE should remove some pressure on heavily loaded or lower-spec servers.
This code is in the hot path of every incoming activity. Reducing the need to SELECT before INSERT/UPDATE should remove some pressure on heavily loaded or lower-spec servers.