In the current implementation, when a new item is added to a list, the following operations are done:
- run a DELETE statemet to remove all the entries that correspond to this list in the associated table
- run as many INSERT statements as there are items in the list
We can do metter and only run INSERT statements when we detect that only new values were added to the list.
However note that the current code has notable behavior when using parallelism. If we INSERT the new list element as a new row, both parallel INSERTs will work but they will both use the same pos attribute so the two inserted elements will be in indeterminate order (and potentially observed differently by different connections). This indeterminism (due to two pos values being the same) will only be corrected if an operation is done on the list that is not a simple append.