473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DB2 Locking: Subquery to a Long Federated Query

I have a situation that is as follows:

First an Index of what is discussed below:

FED_A ->> Federated Objected/Table that has lots of rows

LOC_B ->> Local Table which is selected and updated.

My data flow works through a Informatica workflow and is therefore not
exactly like a single transaction.

This is the start of this Data Flow:

SELECT * FROM FED_A
WHERE FED_A. COL_A >= ( SELECT MAX(LOC_B.COL_A)
FROM LOC_B )

Question One is:

If the data from FED_A takes 5 minutes to fetch and get back which
means it will have a share lock on selected rows for at least that
long.

And if The Subquery on LOC_B took 1 second to execute.

Is there any lock being held at all on Table LOC_B.

My own opinion is that none should be held and not for long.

The LOC_B.COL_A has an index on it and it returns fast when
executed independently (less than a second).

However we are finding that when the above query is in execution
there is SHARE ROW LEVEL LOCK on Table LOC_B which is locking UPDATES
to LOC_B further down the workflow out.

My main question is what is DB2's behaviour for locking on Table
LOC_B in this situtation. Does it hold a lock on LOC_B until the Unit
of Work(UOW) denoted by the whole query is returned?

And if so why does it appear to hold a Share Row Level Lock? Which
Row it will lock?

Sridhar

Nov 12 '05 #1
2 1782
Zri Man wrote:
I have a situation that is as follows:

First an Index of what is discussed below:

FED_A ->> Federated Objected/Table that has lots of rows

LOC_B ->> Local Table which is selected and updated.

My data flow works through a Informatica workflow and is therefore not
exactly like a single transaction.

This is the start of this Data Flow:

SELECT * FROM FED_A
WHERE FED_A. COL_A >= ( SELECT MAX(LOC_B.COL_A)
FROM LOC_B )

Question One is:

If the data from FED_A takes 5 minutes to fetch and get back which
means it will have a share lock on selected rows for at least that
long.

And if The Subquery on LOC_B took 1 second to execute.

Is there any lock being held at all on Table LOC_B.

My own opinion is that none should be held and not for long.

The LOC_B.COL_A has an index on it and it returns fast when
executed independently (less than a second).

However we are finding that when the above query is in execution
there is SHARE ROW LEVEL LOCK on Table LOC_B which is locking UPDATES
to LOC_B further down the workflow out.

My main question is what is DB2's behaviour for locking on Table
LOC_B in this situtation. Does it hold a lock on LOC_B until the Unit
of Work(UOW) denoted by the whole query is returned?

And if so why does it appear to hold a Share Row Level Lock? Which
Row it will lock?

Sridhar

What's the isolation level? For CS I woudl not expect LOCB to hold the lock.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
It is CS

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lev | last post by:
CREATE TABLE . ( NULL , , (44) ) ID is non-unique. I want to select all IDs where the last entry for that ID is of type 11.
0
by: tukaram.thatikonda | last post by:
Hi Guys, I have written a small windows application in VB.Net to test ADO.Net performance while executing long running query. The query works most of the time but fails sometime. I am trying...
4
by: uthuras | last post by:
Greetings all, Is it possible to have federated db feature implemented among DB2 family? I intend to create federated within DB2 databases. I have 2 databases TestA and TestB. I have some base...
4
by: Praveen_db2 | last post by:
Hi All DB2 8.1.3,Windows I have 2 databases in a single instance, say DB_1 and DB_2.I need to query a table from DB_1 in DB_2.I am try to use a nickname for it.But nickname creation is not...
5
by: steven.fafel | last post by:
I am running 2 versions of a correlated subquery. The two version differ slightly in design but differ tremendously in performance....if anyone can answer this, you would be awesome. The "bad"...
3
by: laurentc via AccessMonster.com | last post by:
Hi. I have an issue with my Access project. I have rather big tables of data (about 11 000 rows). These tables are historical product quotations, so they are very simple : - MyDate...
4
by: esmith2112 | last post by:
I have a query running on a federated database that takes the form select col1, col2 from nickname1 where <conditions exist> union all select col1,col2 from nickname2
1
NeoPa
by: NeoPa | last post by:
Access QueryDefs Mis-save Subquery SQL Access stores its SQL for Subqueries in a strange manner :s It seems to replace the parentheses "()"with square brackets "" and (often) add an extraneous...
0
by: imusion | last post by:
Hi, I have 2 servers each running AIX and both have a DB2 database setup on them. I'm building a news management application and in our setup we need to have a staging and production setup. So...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.