Inner join is producing more rows than input
Moderators: chulett, rschirm, roy
Inner join is producing more rows than input
The 2 input sources have 10 rows each. The output is much greater than 10. I am sorting and hash partitioning on the key column on the input of the join. How can it be?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Worst case - every row has the same key value. Every row from the left input will therefore match every row from the right output. You'll get 100 rows output.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
You still don't get it, do you?abc123 wrote:Yes. If my 2 input links have 100 rows each, the maximum I can get is 100 rows on an inner join, right? I can never get more than 100 but I am getting more. I am joining on the key.
With 100 input rows on each, you can get 100 * 100 = 10,000 rows at the most even with an inner join. This happens when the join happens to do a cartesian product since all the key values in both tables are the same. So, the number of output rows really depends on the keys and values.
gateleys