It seems clear that setting synchronous_commit OFF on sessions - on which the super rare drawback (allegedly-committed transactions being lost in case of a server crash) - is fine, increases the performance of those sessions, as they do not have to wait for the WAL to be flushed to disk.
However, what I fail to understand is how that affects all the sessions that commit in the same time window that have synchronous_commit ON.
It is my understanding that sessions that have synchronous_commit OFF produce just as much WAL as those that have it ON (or even more as they get more done in the same time, as they don't have to wait for WALWrite). So the sessions that have it ON will be just as slow as if all sessions had it ON?
Scenario 1:
10 sessions doing heavy DML that have it ON and 10 Sessions that have it OFF.
Scenario 2: 20 sessions doing heavy DML that have it ON.
What I think happens: In scenario 1, the 10 sessions with OFF produce even more WAL than in scenario 2 so the sessions with ON are even longer waiting on WALWrite than in scenario 1.
Am I understanding this right that each commit always waits for ALL current (xid <= own xid) WAL data to be written not only 'ITS OWN' WAL data?