• Also, wouldn't there be a potential concurrency issue with this approach (i.e. select max)? Don't you need to wrap this in a lock and actually perform the insert to prevent collisions?