I cannot say whether optimizations are always used in Jena, but I know
the the algebra stuff has some optimize() methods, probably some pruning
rules, the rest would need some statistics like cardinalities,
join-selectivity, etc. For sure, Andy knows more.
One comment:
You should keep in mind that the order of OPTIONAL is important.
On 26.05.2017 13:25, Laura Morales wrote:
> Does Jena evaluate triples in the WHERE {} block sequentially, or does it try
> to perform any optimizations internally? As a practical example, does
>
> WHERE {
> OPTIONAL {}
> FILTER ()
> }
>
> and
>
> WHERE {
> FILTER ()
> OPTIONAL {}
> }
>
> have a different order of execution, or do they represent the same query to
> Jena?