On 15 May 2013, at 14:10, [email protected] wrote:

> Hello,
> 
> 
> 
> I am using the following Sparql query against a TDB store:
> 
> SELECT * 
> WHERE {
>   ?pat a nci:Patient .
>   ?pat ec:Has_Id ?patId .
>   ?findingProp rdfs:subPropertyOf ec:Has_Finding .
>   ?pat ?findingProp ?finding .
>   ?finding a ?findingType .
> }
> 
> 
> When I run this query WITHOUT the last triple (the bolded line), it returns 
> the correct result within seconds.
> 
> But when I run this query WITH the last triple, the query runs a very long 
> time. I do not know how long b/c I cancelled it after 1 hour.

I wonder wether the optimiser sees '?finding a ?findingType .' as more ground 
than the previous, and thus reorders the query?

Have a look at [1] which explains some of the diagnostic features of TDB. 
Getting hold of the query plan would be very useful.

Damian

[1] 
<https://jena.apache.org/documentation/tdb/optimizer.html#Investigating_what_is_going_on>



Reply via email to