Subject Re: [IBO] HDR and Joins
Author Helen Borrie
At 03:51 PM 7/02/2005 +0100, you wrote:

>I need a little confirmation on a HDR issue.
>AFAIK, Horizontal Dataset Refinement does not work on fields that are
>queried by a join. Is that correct?
> T1.Bla,
> T2.Blubb
> FROM Table1 T1
> LEFT OUTER JOIN Table2 T2 ON (T2.ID = T1.Foreign)
>In this case, ID is the primary key of the two tables.
>Using HDR with column T1.Bla works lightning fast, but
>using column T2.Blubb is horribly slow.
>So I concluded that HDR does not work with joins.

AFAIK, HDR works with everything.

>Is my conclusion correct?

I don't know what conclusion it infers, other than the fact that the data
pulled into a set on the right-hand side of a left join really doesn't do
anything to help establish what goes before or after it. HDR depends on
the KeyFields array to determine the start and end of its buffer
window. Clearly, T1.Bla is going to follow the lefthand stream, which
contains the KeyLink. It can't do anything with t2.Blubb, since that
stream will contain arbitrary nulls and duplicates.

>And if it is not, how can I use HDR on the joined column?

You could use an inner join instead, and include the right-hand stream's
primary key in the set and also in the KeyLinks.