Some SM flows regarding visibility management require more optimal performance due to high parallel load. The PR introduces improvements that are later on reused in the internal SAP flows.
allow updating labels without updating the actual visibility via a new DB storage API - the reason for this being needed is that updating the actual visibility locks the row in the table until the transaction finishes. Certain transactions can take up to 30 seconds and they would slowly lock the whole visibility table row by row making any parallel visibility management requests work synchronously slowing down exponentially as more requests come (the last of five requests would take 5*x time to complete where x is average time a single request takes)
BULK insert and BULK delete labels during label management requests - this makes sure we don't execute multiple DB queries when multiple labels are changed
Remove GET label checks to see if label already exists or not and bake this logic in the actual INSERT label query
make use of the list without labels DB API to list visibilities without labels whenever possible
Coverage increased (+0.03%) to 87.038% when pulling 2f6835df2471a0f1adc4b3b5ae035b5a966a7327 on fix-perf into 0622abb0757cb8b443b5929b79d42aa75c046ca2 on master.
Some SM flows regarding visibility management require more optimal performance due to high parallel load. The PR introduces improvements that are later on reused in the internal SAP flows.