Anonymous
Not applicable

@Ljuboslav Boskic​ 

there can be multiple reasons why the query is taking more time , during this phase metadata look-up activity happens, can you please check on the below things 

  • Ensuring the tables are z-ordered properly, and that the merge key (on clause) included the z-order key and the partition key in it.
  • you can use vacuum and optimise on the source delta tables and please find the below documents 

https://docs.databricks.com/spark/latest/spark-sql/language-manual/delta-vacuum.html

https://docs.databricks.com/spark/latest/spark-sql/language-manual/delta-optimize.html

Please let us know if you still face the same issue

View solution in original post