Merge can take time due to various reasons.
You can try one or combination of the following options:
1. Use the OPTIMIZE command to compact small files into larger ones. This reduces the number of files that need to be read during the MERGE, improving performance.
2. You can use Liquid Clustering
3. If one of the tables in the MERGE operation is small, consider using broadcast joins
4. You can use Change Data Capture (CDC) to efficiently track and manage changes in data for MERGE operations. When using CDC, you can optimize your MERGE statements by only processing the changed records. This minimizes the volume of data scanned and processed, improving overall performance.