Search code examples
javajenaapache-jenaarq

Jena Arq Stage Reordering?


So I know Jena Arq supports stage reordering as an optimization. (See https://github.com/apache/jena/blob/master/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/StageGeneratorGeneric.java)

On line #70, there is a check for if the input is QueryIterRoot -- My issue is every query I submit, the input is QueryIterRoot so it never runs the optimization within that block.

Tracing back the stack, I can't see how to generate a query where QueryIterRoot isn't the input passed to StageGeneratorGeneric. Am I missing something to get stage optimization working?


Solution

  • QueryIterRoot is always one row of no variables so there is no substitution to do and so there is no invalidation of static reordering. It is assumed that the query was optimized by the static optimization step or is left under the user's control.

    For a simple pattern query WHERE { ... basic graph pattern ... } the input will be QueryIterRoot