streaming and sequential flwor

Bug #1026250 reported by Matthias Brantner on 2012-07-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
High
Federico Cavalieri

Bug Description

If a FLWOR has a sequential return clause, all of the binding sequences of the clauses are materialized before the return clause is executed. This behavior is correct according to the latest Scripting specification and avoids confusion if the return clause would modify any input to one of the clauses.

However, the downside is that there is currently no way to stream the input. For example, in the following query, $contents is completely materialized before the sequential local:test function is invoked.

variable $xmlcontents := fetch:content("big-file.xml");

let $contents := parse-xml:parse(
      $xmlcontents,
      <opt:options>
        <opt:parse-external-parsed-entity opt:skip-root-nodes="1" />
      </opt:options>)
for $w at $pos in $contents
return
{
    local:test();
    $w
}

There has been an extensive discussion on zorba-dev (subject "Streaming and Sequential FLWOR -> no good") on this topic but no satisfying solution has been found, yet.

Related branches

Revision history for this message
Chris Hillery (ceejatec) wrote :

I am assigning to Ghislain simply to ensure that it stays on my planning spreadsheet.

Changed in zorba:
assignee: nobody → Ghislain Fourny (gislenius)
Chris Hillery (ceejatec) on 2012-08-25
Changed in zorba:
milestone: 2.7 → none
assignee: Ghislain Fourny (gislenius) → Markos Zaharioudakis (markos-za)
Changed in zorba:
assignee: Markos Zaharioudakis (markos-za) → Matthias Brantner (matthias-brantner)
milestone: none → 2.8
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

The discussion resulted in the following:
- a sequential flwor shouldn't do materialization by default
- a pragma should be available in order to turn materialization on

Chris Hillery (ceejatec) on 2013-01-22
Changed in zorba:
milestone: 2.8 → 2.9
Chris Hillery (ceejatec) on 2013-03-27
Changed in zorba:
milestone: 2.9 → 3.0
tags: added: compiler performance-problem
Chris Hillery (ceejatec) on 2013-08-13
Changed in zorba:
status: New → Confirmed
Changed in zorba:
assignee: Matthias Brantner (matthias-brantner) → Federico Cavalieri (fcavalieri)
status: Confirmed → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers