Draft of #18556 - .remove()/.add() should execute 1 query where possible