Optimizing Multiple Queries against XML Streams
Tim Furche · 2003
Processing and querying streams, XML streams in particular, has recently become a widely recognized area of interest both in research and in industry. In contrast to traditional query evaluation for databases, where multiple queries against the same data can be evaluated sequentially, for a streamed environment only the simultaneous execution of multiple queries is feasible, as the sequential evaluation requires multiple passes over the stream. This work presents an overview of techniques for optimizing multiple queries posed against a stream of XML data. Building upon the SPEX query engine [79; 105], the problem how to find a cost-optimal query plan that allows the simultaneous evaluation of multiple queries against the same stream is presented and shown to be not only hard to solve but also hard to approximate, if arbitrary parts, and not only common prefixes as in previous approaches, can be shared among query plans. Several heuristics are investigated and compared, in particular with respect to their complexity. Furthermore, it is shown how to extend the SPEX query engine to support such query plans for multiple queries. This extension proves to be both natural and efficient. An extensive experimental evaluation shows that sharing arbitrary operators under a realistic cost function results in query plans that have consistently lower cost for reasonable sets of queries than query plans where only common prefixes are considered. In most cases, the relative improvement is higher than 50%. Although the time for generating such query plans is higher than for query plans where only common prefixes are shared, the increase in time is within an acceptable margin.