Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Hash Join

Re: Hash Join

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: 2000/07/25
Message-ID: <397DB6A5.FBDCEB3D@edcmail.cr.usgs.gov>#1/1

Mark did a fine job answering the first question, so I'll just contain my answer to the second question.

> Second. In which case the cardinality of result set of rows after hash
> join could be higher than the highest cardinality of its sources? Is it
> possible for equiajoin?

The cardinality of the result set can be higher than the highest cardinality of its sources. And this is possible for an equijoin. For instance, consider the two tables A & B below:

Table A:
id valueA

1      10
1      20

Table B:
id valueB

1      11
1      12
1      21
1      22

Table B has the highest "cardinality" of 4. (I'm not sure if this is what the poster meant by "cardinality" or not).

A equijoin on these two tables will result in the following set no matter which join method is employed:

SELECT valueA,valueB FROM A,B WHERE A.id = B.id;

valueA valueB

10      11
10      12
10      21
10      22
20      11
20      12
20      21
20      22

Which has "cardinality" of 8.

HTH,
Brian  

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Tue Jul 25 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US