What is faster?
the Merge statement
MERGE INTO table_name
USING dual
ON (row_id = 'some_id')
WHEN MATCHED THEN
UPDATE SET col_name = 'some_val'
WHEN NOT MATCHED THEN
INSERT (row_id, col_name)
VALUES ('some_id', 'some_val')
or
querying a select statement then using an update or insert statement.
SELECT * FROM table_name where row_id = 'some_id'
if rowCount == 0
INSERT INTO table_name (row_id,col_name) VALUES ('some_id','some_val')
else
UPDATE table_name SET col_name='some_val' WHERE row_id='some_id'