In a replication configuration, you can configure the Applier to apply Updates as a pair of Delete and Insert operations in Merge Apply mode. This Applier optimization avoids the overhead of building complex SQL statements for updating primary key columns.
If the primary key columns that the Applier uses to identify rows in a target table are frequently updated on the source, enable this optimization for the table to improve Merge Apply performance. The Applier optimizes processing of Updates if the mapped table has a virtual index that meets the following requirements:
The virtual index includes all of the table columns.
In the
Indexes
dialog box of the Data Replication Console, the
Unique
option is selected for the virtual index.
In the
Indexes
dialog box of the Data Replication Console, the
Supplemental logging
option is selected for the virtual index. This option enables additional database logging for all of the table columns. The Applier requires the before- and after-image values for all of the table columns to build the Delete and Insert statements.
If a virtual index that meets these requirements does not exist, create one. The Applier requires this virtual index to identify the target rows to which to apply the pair of Delete and Insert operations for an Update.
If a mapped table has other virtual indexes for which both the
Unique
and
Supplemental logging
options are selected, clear one of these options for each of the virtual indexes. By clearing an option, you increase the priority of the unique index that includes all of the table columns and decrease the priority of the other virtual indexes. The Applier then uses the unique index with the highest priority to identify the target rows when applying a pair of Delete and Insert operations for optimized Update processing.
You cannot use this optimization if the source table includes columns for which the before- and after-image values are not available in the database log.