When you replicate data to AnalyticDB, source databases are often sharded across multiple tables that share the same schema—for example, orders_2023, orders_2024, and orders_2025. The multi-table merging feature lets you consolidate these tables into a single destination table during migration or synchronization, so you can query all data from one place without post-load transformation.
The feature is available for data migration and synchronization tasks where the destination is an AnalyticDB for MySQL V3.0 or AnalyticDB for PostgreSQL instance.
Limitations
Incompatible with data verification. If a task has the data verification feature enabled, you cannot enable multi-table merging for that task.
DDL operations are not replicated for incremental tasks. When multi-table merging is enabled on an incremental data migration or synchronization task, DTS (Data Transmission Service) does not replicate DDL operations from the source. If you perform DDL operations on the source database, data loss occurs in the destination or the task fails.
Prerequisites
Before you begin, ensure that you have:
A data migration or synchronization task that uses an AnalyticDB for MySQL V3.0 or AnalyticDB for PostgreSQL instance as the destination database
The task open at the Configure Objects and Advanced Settings step in the configuration wizard
For help creating a synchronization task, see Overview of data synchronization scenarios. For migration tasks, see Overview of data migration scenarios.
Enable multi-table merging
The following steps use a data synchronization task as an example.
In the Configure Objects and Advanced Settings step, configure all parameters above Merge Tables.
Set Merge Tables to Yes.
(Optional) Decide whether to enable the
__dts_data_sourcetag column. The__dts_data_sourcecolumn is a custom tag column added to the merged destination table. It records which source table each row originated from, which is useful when you need to trace data back to its source after merging.NoteYou can configure the column name and tag values only after the task is purchased.
Setting Effect Yes DTS adds the __dts_data_sourcecolumn to the destination table. You must assign a unique tag value per source table in a later step.No DTS does not add the column. Source traceability is not available. In the Source Objects section, select the tables to merge, then click
to move them to the Selected Objects section.In the Selected Objects section, right-click a table and choose Edit Table Name. In the dialog box, set Table Name to the name of the destination table. To merge multiple source tables into one destination table, assign all of them the same Table Name value. The following example shows how three source tables map to a single destination table:
Source table Table Name (destination) orders_2023ordersorders_2024ordersorders_2025orders
Repeat the previous step for all tables you want to merge.
ImportantAll source tables to be merged must share the same Table Name value.

Complete the remaining configuration steps following the on-screen instructions. If you set Set the value of __dts_data_source to Yes in step 3, go to the Configure Database and Table Fields step and enter a unique tag value in the Value of __dts_data_source column for each source table. The value of __dts_data_source column cannot be reused.
