[ 
https://issues.apache.org/jira/browse/JENA-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434066#comment-13434066
 ] 

Andy Seaborne commented on JENA-294:
------------------------------------

Good idea although it's a bit more tricky for a complex left-hand side of 
optional.

Two general cases to be dealt with: the ubiquitous, doubly nested optional:

OPTIONAL {
   ... no use of ?y ....
   OPTIONAL { ... uses ?y ... }
}
FILTER (?y = <x>)

and a specific case of ...
OPTIONAL {
   ... does not match ...
}
FILTER (?y = <x>)

I wonder if the right thing to do if push the assignment itself inside the 
OPTIONAL right hand side.  With a unit left handside, this is possible - the 
generalisation (needs testing) is that the LHS does not use the filter variable.

Doubly nested optionals can only be transformed this way if the they can be 
converted to (conditional) later.  Therefore either reorder the optimize so the 
(conditional) test is first and be more aggressive on condition or expose the 
test in some way.

The optimizer tests are in TestOptimizer


                
> TransformFilterEquality does not handle starting OPTIONAL well
> --------------------------------------------------------------
>
>                 Key: JENA-294
>                 URL: https://issues.apache.org/jira/browse/JENA-294
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>    Affects Versions: Jena 2.7.4
>            Reporter: Simon Helsen
>         Attachments: patch.txt
>
>
> There was one other case where our tests were stuck on a very slow query 
> execution because transformFilterEquality failed to optimize. The problem is 
> that the optimizer gives up whenever the WHERE clause starts with an OPTIONAL 
> clause. The reason is that the generated algebraic formula starts with a 
> TableUnit and this is not handled correctly. 
> I have attached a patch which fixes the problem

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to