Now a moments inspection indicates that deliveryAddress and customerAddress are merely placeholders for the true type of the element (which is Address). Each outer element acts as a convenient name to distinguish two instances of the same type.
We examine the node b1 which is useful because of a1 . TB is advanced and b2 is the next B-node. Similarly, a2 is also useful. Now there are no further A-nodes in TA . The B-node b2 is useful because of a2 . TB is advanced. The stream TC is advanced and c2 is useful because of a1 . Hence the solution is returned by using one forward scan, constant memory for each useful nodes and constant time processing each of the nodes in the stream. We have skipped the details of the reconstruction of the result from the encoding of the intermediate results produced by the TwigStack algorithm.
Kt )-th scan is not performed, there is a scan processing some (ri , ki )-subtrees and some (ri , k)-subtrees for some k in one scan. By the same argument used in the proof of Lemma 1, we can construct a case such that some of the solution is not reported. Thus, all O(d t ) scans are necessary. 5 Conclusions We studied processing twig queries – the core operation for XML query processing – over streams of XML documents. We showed that it is not possible to develop an asymptotically optimal holistic twig join algorithm in the context of data streaming.