<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 28, 2014 at 12:32 PM, Adam Retter <span dir="ltr"><<a href="mailto:adam.retter@googlemail.com" target="_blank">adam.retter@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> I have sequence A consisting of the numbers 0 to 4000000 and sequnce B<br>
> consisting of about 100k random I numbers within the range of sequence A and<br>
> I want the outer join where sequence B is "null".<br>
<br>
</span>There is no 'null' in XQuery, so I am not quite sure what you mean<br>
here. If you ware looking for all values that appear in sequence A and<br>
sequence B, then you can do the following -<br>
<br>
$a[. = $b]<br>
<span class=""><br></span></blockquote><div><br></div><div><br></div><div>I meant null in the SQL sense of outer join - sorry. </div><div><br></div><div>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.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
> Should one expect bad performance in sequence B is not sorted and can one<br>
> expect reasonable performance if it is?<br>
<br>
</span>I think that question is very implementation specific. If all of your<br>
data is in RAM, as your dataset is relatively small and these are just<br>
numbers, I would expect performance to be excellent. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I am not sure<br>
that sorting will make much of a difference, but it depends on the<br>
implementation and how it initiates the search for a false comparison<br>
in a large sequence.<br><span class=""><br></span></blockquote><div><br></div><div>that's good - the nightmare scenario is a O^n2 algorithm if B is not sorted </div></div><br></div></div>