Open etcd opened 8 months ago
Some ideas on the syntax:
update tbl add to tags (1,2)
update tbl remove from tags (1,2)
update tbl set tags=+(1,2),-(4,5)
I like that. Not sure if this reduces implementation workload drastically, but if the first two exist, the third doesn't seem necessary (or conversely, if the third exists, no need for first two).
Is your feature request related to a problem? Please describe. According to the documentation, MVAs are stored internally as a sorted set. However, they don't support basic set update operations such as
add
andremove
, and these would be very nice to have.Describe the solution you'd like It would be nice for MVAs to support basic set update operations like
add
andremove
.Describe alternatives you've considered Making any update to an MVA value requires replacing the entire value. For instance, given the following table and initial data:
The only way to remove a value from the MVA (e.g.,
4
) is by replacing the entire MVA:In this toy example with only a few values, it's not too bad. However, this is very unwieldy and inefficient when working with large MVAs. For example, to remove a value from an MVA, you currently have to SELECT the MVA value, then find the value to remove, then perform an UPDATE query. That's two queries and a lot of bandwidth - not to mention, if MVAs grow to be very large (say 1000 multi64 values = 8KB), you will also run into a practical limit to the size of the UPDATE query.