Keywords lookupid update in the database upon label change in the WB

Let’s say that you have a keyword with a few choices. If you update one of the label choices, then the lookupid is changed in the rxlookup table.
Example: I change the label for the “Product X” choice in my Products keyword, and save it in the WB. In the rxlookup table, the record for that choice is deleted and a new record is created, which of course will have a new lookupid (primary key).

My question is: Why do we delete and re-create a record in the rxlookup table every time that the label (lookupdisplay) changes? It is the same exact choice, only the label has been updated.

This is causing an issue for OCC since they concatenate the lookupid and the lookupvalue to have a unique node id for their checkbox tree.

I looked at the code. When a keyword is updated, its choices are updated by label, meaning the existing choices are identified by label, not id. So when you change the label, the existing choice is not found. A new entry is created and the existing one is removed.