The node_access_write_grants() function currently deletes all entries in node_access and re-inserts them, even if the existing grants are not modified.
This created a lot of unnecessary write traffic to the database.
This function should check the existing grants and execute DML statements if needed.