SAP HANA. Operation Delta Merge

Good afternoon, colleagues. Today I would like to talk about such a regular and important operation taking place in the SAP HANA database as Delta Merge.





In the HANA database concept, changes to columnar tables do not happen directly in the Main store. This is because the MAIN area is optimized for read operations, not write operations. All write operations take place in a special area called the Delta store. In this case, read operations are performed from both areas.





Periodically it is necessary to update the main storage area of ​​the column tables (main store) with the contents of the delta store area. The process of merging these two areas is called delta merge. This process can be broken down into three stages: the operation performed immediately before the merge, during the merge, and after the merge. The delta merge process can be schematically represented as follows:





Schematic representation of a Delta Merge operation
Schematic representation of a Delta Merge operation

At the first stage (before the start of the delta merge operation), we see that there are two areas Main1 and Delta1. Reading is performed from both areas, but writing occurs only to the Delta1 area.





delta merge, Main2 Delta2. Main1 Main2 ( 1). (committed) Delta1 Main2 ( 2). (uncommitted) Delta 1 Delta2 ( 3). Main1, Delta1, Delta2. Delta2.





, , Main1 Delta1 . Main2 Delta2. Delta2.





, ( ) delta merge . , Delta1 Delta2 , .





Delta Merge.





Delta Merge Operation Types
Delta Merge

, . mergedog, SQL. , (implicit) merge, mergedog , Recovery Log replay.





Delta merge

delta merge , (Auto), , , (Critical), . .





Auto merge.  MERGE :





indexserver.ini -> [mergedog] -> activate (boolean), default: true





indexserver.ini -> [mergedog] -> check_interval (ms), default: 60000





indexserver.ini -> [mergedog] -> auto_merge_decision_func





[mergedog] true. ( check_interval) mergedog merge . Auto merge auto_merge_decision_func.





Critical merge.  MERGE mergedog . Critical merge :





indexserver.ini -> [mergedog] -> critical_merge_decision_func





Delta Merge

DELTA MERGE. :





Hard Force merge





, , MERGE. Hard merge :





MERGE DELTA OF “<table_name>” [FORCE REBUILD]





DELTA MERGE ( ) . FORCE REBUILD , delta merge, , , (decision function), .





WITH PARAMETERS (‘FORCED_MERGE’ = ‘ON’) FORCED MERGE, .





Smart merge





merge . , BW. . , Smart merge , .





indexserver.ini -> [mergedog] -> smart_merge_enabled





indexserver.ini -> [mergedog] -> smart_merge_decision_func





Smart merge :





MERGE DELTA OF “<table_name>” WITH PARAMETERS (‘SMART_MERGE’ = ‘ON’)





! , .





SAP ABAP TREX_EXT_MERGE_DELTA_INDEX smart merge .





Memory merge





SAP HANA 1.0 SP8 Memory merge, Hard merge. , , .





! . , .





Merge Monitor

. Merge Monitor.





( 2057046) , , . , .





() Merge . merge token, FORCE MERGE. Merge . . , , load_balancing_func indexserver.ini. merge, . , token_per_table.





Delta Merge, M_DELTA_MERGE_STATISTICS, . HOST_DELTA_MERGE_STATISTICS _SYS_STATISTICS. Merge. Merge TYPE ‘MERGE’. :





Values ​​in the TYPE field of the M_DELTA_MERGE_STATISTICS and HOST_DELTA_MERGE_STATISTICS views
TYPE M_DELTA_MERGE_STATISTICS HOST_DELTA_MERGE_STATISTICS

Delta Merge M_JOB_PROGRESS.





, Delta merge , . : main () + main () + delta. , .





delta merge (TYPE='SPARSE' M_DELTA_MERGE_STATISTICS), Pool/OptimizeCompression/<schema>:<table>. , .





Delta Merge

Delta Merge . LAST_ERROR ERROR_DESCRIPTION M_DELTA_MERGE_STATISTICS HOST­_DELTA_MERGE_STATISTICS. SQL HANA_Tables_ColumnStore_Merges.





SAP KBA 2057046 – FAQ: SAP HANA Delta Merges





HANA. delta merge , . Basis, BW .








All Articles