Oracle Merge vs Select then Insert or Update

前端 未结 2 1707
天命终不由人
天命终不由人 2021-02-03 10:39

What is faster?

the Merge statement

    MERGE INTO table_name 
     USING dual
     ON (row_id = \'some_id\')
    WHEN MATCHED THEN
     UPDATE SET col_n         


        
2条回答
  •  伪装坚强ぢ
    2021-02-03 11:14

    Take care of the merge. It can consume a lot of your area TEMP using HASH JOIN. Test him using hint FIRST_ROWS or use UPDATE view join plus INSERT with NOT EXISTS.

提交回复
热议问题