Hi all,
DB2 V8 LUW FP 15
There is a table T (ID varchar (24), ABC timestamp). ID is PK.
Our application needs to frequently update T with a new value for ABC.
update T set ABC=? where ID = ?
However, a condition was found where the application was trying to
update T without inserting a row first. We decided to change the
simple Update statement to a MERGE.
MERGE into T using
(
values ('xyz','a timestamp')
) as indata (ID, ABC)
ON (T.ID = indata.ID)
when matched then update set ABC = indata.abc
when not matched then insert (ID,ABC) values (indata.ID, indata.ABC)
We solved the first problem, but it seems like we have introduced a
concurrency problem using Merge. All concurrent applications seems
slower when trying to update table T. I have taken snapshots and
several merges run at the same time. We did not have this issue
running Updates.
What performance penalty should I expect when using merge instead of
update ? I know merge runs on CS isolation, but is there anything I am
missing here ?
Thanks,
Michel
DB2 V8 LUW FP 15
There is a table T (ID varchar (24), ABC timestamp). ID is PK.
Our application needs to frequently update T with a new value for ABC.
update T set ABC=? where ID = ?
However, a condition was found where the application was trying to
update T without inserting a row first. We decided to change the
simple Update statement to a MERGE.
MERGE into T using
(
values ('xyz','a timestamp')
) as indata (ID, ABC)
ON (T.ID = indata.ID)
when matched then update set ABC = indata.abc
when not matched then insert (ID,ABC) values (indata.ID, indata.ABC)
We solved the first problem, but it seems like we have introduced a
concurrency problem using Merge. All concurrent applications seems
slower when trying to update table T. I have taken snapshots and
several merges run at the same time. We did not have this issue
running Updates.
What performance penalty should I expect when using merge instead of
update ? I know merge runs on CS isolation, but is there anything I am
missing here ?
Thanks,
Michel
Comment