473,491 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

question on Hash Joins

I am not able to really understand the explain plan output in case of
hash joins.
When tables A & B are being joined, how do I know which table is
being
hashed during first phase (build phase) ?

Is it true that the indexes will never be used in case of hash joins
e?
(I aways see "Relation Scan" in the explain output).
Thanks
Dave

Jan 30 '07 #1
3 1879
Veeru71 wrote:
I am not able to really understand the explain plan output in case of
hash joins.
When tables A & B are being joined, how do I know which table is
being
hashed during first phase (build phase) ?

Is it true that the indexes will never be used in case of hash joins
e?
(I aways see "Relation Scan" in the explain output).
Thanks
Dave
In db2exfmt the left branch is the build, the right branch is the probe.
If indices were considered beneficial to compute the join, then DB2
would most likely pick a nested loop (with an index probe) or a merge
join (based on the index order).
The only scenario I can imagine where an index scan may win would be a
covering index. (ISCAN without a FETCH).

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 30 '07 #2
Maybe an index would also be picked up if it is a block index of a MDC.

Cheers,

Jean-Marc

"Serge Rielau" <sr*****@ca.ibm.coma écrit dans le message de
news:52*************@mid.individual.net...
Veeru71 wrote:
I am not able to really understand the explain plan output in case of
hash joins.
When tables A & B are being joined, how do I know which table is
being
hashed during first phase (build phase) ?

Is it true that the indexes will never be used in case of hash joins
e?
(I aways see "Relation Scan" in the explain output).
Thanks
Dave
In db2exfmt the left branch is the build, the right branch is the probe.
If indices were considered beneficial to compute the join, then DB2
would most likely pick a nested loop (with an index probe) or a merge
join (based on the index order).
The only scenario I can imagine where an index scan may win would be a
covering index. (ISCAN without a FETCH).

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Jan 30 '07 #3
Serge Rielau wrote:
Veeru71 wrote:
>I am not able to really understand the explain plan output in case of
hash joins.
When tables A & B are being joined, how do I know which table is being
hashed during first phase (build phase) ?
In db2exfmt the left branch is the build, the right branch is the probe.
I stand corrected: RIGHT = BUILD, LEFT = PROBE. Like an NL join where
the inner is temped (built) and the outer then probes the inner...
Thanks to Miro for pointing that out.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 31 '07 #4

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

Similar topics

3
5194
by: soup_or_power | last post by:
Can someone explain this code especially what it is doing with Storable::dclone? Thanks in advance sub new { my ($self, $hash) = @_; # ------------------------------------------------------...
47
5023
by: VK | last post by:
Or why I just did myArray = "Computers" but myArray.length is showing 0. What a hey? There is a new trend to treat arrays and hashes as they were some variations of the same thing. But they...
5
276
by: Timur | last post by:
Hi gurus, I have a problem to convert MS SQL Server application to DB2. I have a view which combines 7 tables ( table sizes 60millions rows, 3 mill, 1 mill, other small ones) I use this view to...
4
1900
by: Lauren Quantrell | last post by:
In my old MDB databases, I constructed a lot of "subQueries" to filter out records, then based a new query on the subQuery. This results in huge speed increases on large datasets. However... In...
1
1523
by: Matthew Wells | last post by:
I have a one to many relationship between two tables. The "one" table has a 5 field PK (total 7 fields, 1400 records) and the "many" table has a 7 field PK (total 15 fields, 1500 records). I...
13
2153
by: Elaine | last post by:
This has to do with self-joins and includes a running balance problem. Is it possible to do this using SQL alone? Amortization schedule -------------------------- Givens: beginning balance,...
4
2191
by: Uwe C. Schroeder | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Here's a question for the SQL guru's out there, which I've been trying to solve for the last couple of hours. There's got to be a solution to...
2
1368
by: Terrance | last post by:
Hello, I have a question in regards to hashtables that I was hoping someone can share some light on. I'm currently working with VB.net and I'm trying to learn as much as possible about the...
25
2354
by: eggie5 | last post by:
I have a form where a user can change his password, but I'm confused on how to prevent this from being transmitted in plain text. Well, I know how not to transmit it in plain text - use any type...
0
6978
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
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
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...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.