Comment 1 for bug 1011126

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

The problem is not string-streaming but related to inlining a let variable that is only used once. The problem can be reproduced using the following much smaller query:

let $result := (1 to 10000000)
return subsequence($result, 1, 1)

The plan for this query is (note materialize="true" in the LetVariable)

<flwor::FLWORIterator id="1006">
  <LetVariable name="result" materialize="true" referenced-by="1003">
    <OpToIterator id="1002">
      <SingletonIterator value="xs:integer(1)" id="1000"/>
      <SingletonIterator value="xs:integer(100000000)" id="1001"/>
    </OpToIterator>
  </LetVariable>
  <ReturnClause>
    <LetVarIterator varname="result" id="1003">
      <SingletonIterator value="xs:integer(1)" id="1004"/>
      <SingletonIterator value="xs:integer(1)" id="1005"/>
    </LetVarIterator>
  </ReturnClause>
</flwor::FLWORIterator>

I'm assigning this to Markos for further investigation.