Created by: unknwon
We used to rely on ON CONFLICT ON CONSTRAINT
to do upsert when we do batch update on user_pending_permissions
table. However, there are reasons why the approach in this PR is better (use update not upsert):
id
) of user_pending_permissions
table is increased rapidly every time hits ON CONFLICT ON CONSTRAINT
for no obvious benefit. (Have seen a customer with few thousand rows but MAX(id)
>80,000,000).id
s on hand, could have just used it to directly update rows with these id
s as they are primary keys.This PR does not solve 1. entirely but at least slows down id
increment pace by half. Another half is caused by: