Using Oracle's MERGE for pure deletes
Posted: Wed May 23, 2007 1:54 pm
Just curious if any Oracle peoples out there have any thoughts on using a MERGE for pure deletes? While it is great for "upsert" type operations, it doesn't really seem to provide a pure delete functionality.
From what I can tell, you have an optional DELETE WHERE clause that can be added to the WHEN MATCHED operation. Problem is it seems to want to do some kind of an update first and then possibly also delete after the update if the delete where clause is also true. It's not an 'either/or' but more of a 'one or both' thing.
That doesn't seem all that efficient when you want to do are pure deletes. I'm not looking for alternatives to the MERGE for deletes, I've got them. I'm just looking for some verification of my understanding as to How It Works, especially wrt the DELETE WHERE part of the game.
Thanks!
![Confused :?](./images/smilies/icon_confused.gif)
From what I can tell, you have an optional DELETE WHERE clause that can be added to the WHEN MATCHED operation. Problem is it seems to want to do some kind of an update first and then possibly also delete after the update if the delete where clause is also true. It's not an 'either/or' but more of a 'one or both' thing.
That doesn't seem all that efficient when you want to do are pure deletes. I'm not looking for alternatives to the MERGE for deletes, I've got them. I'm just looking for some verification of my understanding as to How It Works, especially wrt the DELETE WHERE part of the game.
Thanks!