[xquery-talk] outer join between 2 sequences

Ihe Onwuka ihe.onwuka at gmail.com
Sun Sep 28 04:42:43 PDT 2014


On Sun, Sep 28, 2014 at 12:32 PM, Adam Retter <adam.retter at googlemail.com>
wrote:

> > I have sequence A consisting of the numbers 0 to 4000000 and sequnce B
> > consisting of about 100k random I numbers within the range of sequence A
> and
> > I want the outer join where sequence B is "null".
>
> There is no 'null' in XQuery, so I am not quite sure what you mean
> here. If you ware looking for all values that appear in sequence A and
> sequence B, then you can do the following -
>
> $a[. = $b]
>
>

I meant null in the SQL sense of outer join - sorry.

I want to drop the things that are in B from A where both B and A are just
sequences of integers. In other words, don't fetch what I've already got.



>
> > Should one expect bad performance in sequence B is not sorted and can one
> > expect reasonable performance if it is?
>
> I think that question is very implementation specific. If all of your
> data is in RAM, as your dataset is relatively small and these are just
> numbers, I would expect performance to be excellent.

 I am not sure
> that sorting will make much of a difference, but it depends on the
> implementation and how it initiates the search for a false comparison
> in a large sequence.
>
>
that's good - the nightmare scenario is a O^n2 algorithm if B is not sorted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20140928/ac1d4db4/attachment.html>


More information about the talk mailing list