7 Querying Large XML Documents


The DataDirect XQuery Streaming XML feature of the XML Adaptor minimizes memory use when querying large XML documents by simultaneously parsing the XML document, executing the query, and sending the data to the application as needed. In contrast, the XML Adaptor loads the complete XML document in memory and creates an optimized in-memory representation of the complete document. Then, the in-memory representation is used during query execution. In general, the XML Adaptor uses more memory than the XML Adaptor with the Streaming XML feature enabled. By default, the Streaming XML feature is enabled.

DataDirect XQuery supports streaming on XML documents accessed through:

The Streaming XML feature is used on a per XML document basis. For example, in a single query, the Streaming XML feature can be used for XML document A and not for XML document B. The Streaming XML feature is not used in the following circumstances:

In addition, in the following circumstances, some expressions can cause the Streaming XML feature to stop processing the current node: