dbTalk Databases Forums  

use "with ur" in a merge statement?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss use "with ur" in a merge statement? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Henry J.
 
Posts: n/a

Default use "with ur" in a merge statement? - 06-29-2010 , 10:39 AM






What would happen if "with ur" is appended at the end of a merge
statement? Would it have the same effect as in a "insert into ...
select from ..." statement, i.e., no lock is acquired on the tables in
the "using" clause?

Thanks!

Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: use "with ur" in a merge statement? - 07-01-2010 , 08:16 AM






On 6/29/2010 11:39 AM, Henry J. wrote:
Quote:
What would happen if "with ur" is appended at the end of a merge
statement? Would it have the same effect as in a "insert into ...
select from ..." statement, i.e., no lock is acquired on the tables in
the "using" clause?

Thanks!
You would have to append it to the select in the USING clause.
I do not think we support WITH UR at teh end of MERGE (although I have
not checked that).
If it were supported then everything except for the select over teh
MERGe target would be UR (including any subqueries in the SET or VALUES
and MATCHED clauses.

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
  #3  
Old   
Henry J.
 
Posts: n/a

Default Re: use "with ur" in a merge statement? - 07-01-2010 , 12:59 PM



On Jul 1, 9:16*am, Serge Rielau <srie... (AT) ca (DOT) ibm.com> wrote:
Quote:
On 6/29/2010 11:39 AM, Henry J. wrote:> What would happen if "with ur" isappended at the end of a merge
statement? * Would it have the same effect as in a "insert into ...
select from ..." statement, i.e., no lock is acquired on the tables in
the "using" clause?

Thanks!

You would have to append it to the select in the USING clause.
I do not think we support WITH UR at teh end of MERGE (although I have
not checked that).
If it were supported then everything except for the select over teh
MERGe target would be UR (including any subqueries in the SET or VALUES
and MATCHED clauses.

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
From my tests, it seems WITH UR at the end of MERGE is indeed
supported and working as you described.

Thanks.

Reply With Quote
  #4  
Old   
Serge Rielau
 
Posts: n/a

Default Re: use "with ur" in a merge statement? - 07-03-2010 , 07:54 AM



On 7/1/2010 1:59 PM, Henry J. wrote:
Quote:
On Jul 1, 9:16 am, Serge Rielau<srie... (AT) ca (DOT) ibm.com> wrote:
On 6/29/2010 11:39 AM, Henry J. wrote:> What would happen if "with ur" is appended at the end of a merge
statement? Would it have the same effect as in a "insert into ...
select from ..." statement, i.e., no lock is acquired on the tables in
the "using" clause?

Thanks!

You would have to append it to the select in the USING clause.
I do not think we support WITH UR at teh end of MERGE (although I have
not checked that).
If it were supported then everything except for the select over teh
MERGe target would be UR (including any subqueries in the SET or VALUES
and MATCHED clauses.
From my tests, it seems WITH UR at the end of MERGE is indeed
supported and working as you described.
*phew* :-)

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
  #5  
Old   
Henry J.
 
Posts: n/a

Default Re: use "with ur" in a merge statement? - 07-03-2010 , 12:58 PM



On Jul 3, 8:54*am, Serge Rielau <srie... (AT) ca (DOT) ibm.com> wrote:
Quote:
On 7/1/2010 1:59 PM, Henry J. wrote:

On Jul 1, 9:16 am, Serge Rielau<srie... (AT) ca (DOT) ibm.com> *wrote:
On 6/29/2010 11:39 AM, Henry J. wrote:> *What would happen if "withur" is appended at the end of a merge
statement? * Would it have the same effect as in a "insert into ...
select from ..." statement, i.e., no lock is acquired on the tables in
the "using" clause?

Thanks!

You would have to append it to the select in the USING clause.
I do not think we support WITHURat teh end of MERGE (although I have
not checked that).
If it were supported then everything except for the select over teh
MERGe target would beUR(including any subqueries in the SET or VALUES
and MATCHED clauses.
*From my tests, it seems WITHURat the end of MERGE is indeed
supported and working as you described.

*phew* :-)

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
Serge, could it be possible that adding "WITH UR" would slow down a
merge statement? It's what happened when I added "WITH UR" to a merge
statement. Hard to tell if the slowness was caused by other factors,
as this was the only change... Thanks.

Reply With Quote
  #6  
Old   
Serge Rielau
 
Posts: n/a

Default Re: use "with ur" in a merge statement? - 07-04-2010 , 09:44 PM



On 7/3/2010 1:58 PM, Henry J. wrote:
Quote:
Serge, could it be possible that adding "WITH UR" would slow down a
merge statement? It's what happened when I added "WITH UR" to a merge
statement. Hard to tell if the slowness was caused by other factors,
as this was the only change... Thanks.
Hmmm,...
I don't see why, but get a db2exfmt with and without the clause and compare.
A WITH UR on a subquery I could fathom as restricting what the optimizer
can do, but a "global" WITH UR should have the same effect as setting
the isolation level for the session.



--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.