Now that custom dimensions is included in core I think we could improve the performance of the tracker and have less updates.
Currently, as soon as a custom dimension is configured for a site, we execute an additional query like
UPDATE log_visit SET last_idlink_va = '2222' WHERE idsite = '1' AND idvisit = '3333'.
We could maybe get rid of this extra update query for existing visits if we knew we first insert the action and then update the visit. Then we could in the regular visit update also update the
last_idlink_va. Not sure if there would be maybe a reason this wouldn't work and whether we have to update the visit before the action.
For new visits this would not work because we need to have the idvisit to insert the action. This likely makes this quite tricky to implement...