Patent ID: 7937375

Claim:
A method for masking index values in a database, the method comprising: receiving a request to mask an indexed column of a table in a database; retrieving an index, which comprises a tree that provides a sorted representation of values in the column, wherein leaf-nodes of the tree are associated with fields to be masked in the column; responsive to a difference between a lower-bound and an upper-bound for a leaf-node of the tree being larger than a threshold, generating a node value between the lower-bound and the upper-bound for the leaf-node such that the tree does not need to be resorted after masking the field associated with the leaf-node, wherein the node value is within a lower-bound and an upper-bound determined by the values of nodes adjacent to the leaf-node in the tree; responsive to the difference between the lower-bound and the upper-bound not being larger than the threshold, adjusting the lower-bound or the upper-bound so that their difference is larger than the threshold, and generating a node value between the post-adjustment lower-bound and upper-bound; masking the leaf-node of the tree using the generated node value without resorting the tree; and masking the field in the column associated with the leaf-node of the tree using the generated node value, thereby masking both the tree and the table in the database while traversing the tree.