Index Refresh Rules
Published 06 January 2020
This documentation is only available in Data Masker for SQL Server.
Data Masker downloads schema information and saves it into masking set statically. When the schema is changed, a manual refresh under Rule Controllers is needed, in order to configure rules against the new schema. However when the schema is modified dynamically by a Command rule or other rules, in order for subsequent rules to be aware of the modified schema, a dynamic refresh is necessary. This is what a group of refresh rules is designed for.
Substitution Rule (and some other rules) require primary key or unique index on the table it operates on. Sometimes if the table does not have an index, a Command rule can be used to create the index dynamically before the subsequent Substitution Rule (or other rules) run. However, only adding the index before the substitution rule is not enough to run it successfully, because the index information is saved statically. To make the substitution rule be able to access the dynamically created index information, an Index Refresh rule needs to be inserted between the command rule that adds the index and the substitution rule that uses the index. Usually we will also have a command rule at the end to delete the index, so that the schema is not modified after a masking run, creating the following rule structure.
Rule structure for using Index Refresh Rule
Another thing that Index Refresh Rules do is that it refreshes all the Index Disable/Enable rules under the same controller, in the same way that Refresh Table And Index Form under Rule Controllers does. After the Index Refresh Rule is executed, all Index Disable/Enable Rules under the same controller will have the up-to-date view of the index information in the schema.