Thanks Mike. I did use query-meters, and cache misses were pretty low, at
about 2% of the total hits. One thing I noticed is that when I turn
optimization off ("optimize=0"), the query runs fine. When optimize is set
to 1 or 2, I start seeing the timeout issues again. Any thoughts on that?
Thanks,
Joel
On Wed, Jul 30, 2014 at 12:10 PM, Michael Blakeley <[email protected]>
wrote:
> The latest release is 7.0-3 and includes several bug fixes related to
> triples and SPARQL. So I'd try upgrading first, and see if that helps.
>
> If that doesn't help, it could be that it works when enough data is in
> cache, and times out when it has to do too much I/O because data isn't
> cached. You might take a look at http://{$hostname}:8002/history/ and see
> if you can correlate that activity with your queries. Or watch
> http://{$hostname}:8002/dashboard/load/
> while running the query, and watch the query read load.
>
> It might also be revealing to wrap the sparql in XQuery, so you can get
> xdmp:query-meters() output. In qconsole you'd set the "Query Type" selector
> to "XQuery".
>
> sem:sparql('SELECT ...')
> ,
> xdmp:query-meters()
>
> That will only show output if the query succeeds. You might be able to
> show how far the query got before timing out with a try-catch expression:
>
> try {
> sem:sparql('SELECT...')
> } catch($ex) { $ex }
> ,
> xdmp:query-meters()
>
> Either way the data on cache hits and misses might tell us something.
>
> -- Mike
>
> On 30 Jul 2014, at 08:29 , Joel Ruisi <[email protected]> wrote:
>
> > I'm having a problem with a SPARQL query that sometimes works fine, and
> other times times out. Most of the time it times out. I'm running it
> through qconsole using sem:sparql.
> >
> > Marklogic Version: 7.0-2.3
> >
> > Here's an example of the query:
> >
> > SELECT DISTINCT ?test1 ?test2 ?test3 ?test4 ?test5 ?test6 ?test7 ?graph
> > FROM NAMED <rdf>
> >
> > WHERE {
> > GRAPH ?graph {
> > ?person pref:name "Test" .
> > ?person rdf:type <http://test/tester.owl#Person> .
> >
> > ?object stef:name ?test1 .
> > ?object rdf:type equip:Object .
> > ?object pref:directType ?test5 .
> > ?object daf:UUID ?test7 .
> >
> > ?test4 pref:associatedWith ?person .
> > ?test4 pref:associatedWith ?object .
> > ?test4 msg:containedIn ?Message .
> >
> > ?Message msg:nodeId ?test6 .
> > ?Message pref:directType ?test3 .
> > ?Message msg:messageURI ?test2 .
> > ?Message rdf:type ?test3 .
> > ?Message msg:validMessage "true" .
> > }
> > }
> >
> > I've enabled some trace flags, and here is the output for the failed
> query:
> >
> > [Event:id=SPARQL AST] sessionKey=1530478562463724765
> > 2014-07-30 14:07:59.023 Info: plan=SPARQLModule[
> > 2014-07-30 14:07:59.023 Info: Prolog[]
> > 2014-07-30 14:07:59.023 Info:
> SPARQLSelect[SPARQLDistinct[SPARQLProject[order()
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var name 0]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var message 1]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var messageType 2]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var event 3]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var equipmentType 4]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var nodeId 5]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var uniqueId 6]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]
> > 2014-07-30 14:07:59.023 Info: SPARQLScatterJoin[order(8,7)
> hash(7==7,8==8,10==10)
> > 2014-07-30 14:07:59.023 Info: SPARQLBloomJoin[order(9,0,7)
> hash(7==7,9==9,10==10)
> > 2014-07-30 14:07:59.023 Info: SPARQLBloomJoin[order(3,10,7)
> hash(7==7,8==8)
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(8,7) OPS
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var hvi 8]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test#name>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Literal "HOLMES"]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]
> > 2014-07-30 14:07:59.023 Info:
> SPARQLScatterJoin[order(3,10,7) hash(3==3,7==7)
> > 2014-07-30 14:07:59.023 Info:
> SPARQLScatterJoin[order(3,8,7) hash(3==3,7==7)
> > 2014-07-30 14:07:59.023 Info:
> SPARQLBloomJoin[order(9,3,7) hash(7==7,9==9)
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(9,7) OPS
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> equipment 9]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test#Equipment>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph
> 7]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(9,3,7) OPS
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var event
> 3]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test#associatedWith>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> equipment 9]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph
> 7]]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(3,8,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var event 3]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test#associatedWith>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var hvi 8]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph
> 7]]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(3,10,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var event 3]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/Message.owl#containedIn>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]]]
> > 2014-07-30 14:07:59.023 Info: SPARQLHashJoin[order(9,0,7)
> hash(7==7,9==9)
> > 2014-07-30 14:07:59.023 Info: SPARQLHashJoin[order(9,6,7)
> hash(7==7,9==9)
> > 2014-07-30 14:07:59.023 Info:
> SPARQLHashJoin[order(9,4,7) hash(7==7)
> > 2014-07-30 14:07:59.023 Info:
> SPARQLHashJoin[order(10,1,7) hash(7==7,10==10)
> > 2014-07-30 14:07:59.023 Info:
> SPARQLMergeJoin[order(10,2,7) hash(2==2,7==7,10==10)
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(10,2,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> messageType 2]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> graph 7]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(10,2,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://www.openrdf.org/schema/sesame#directType>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> messageType 2]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> graph 7]]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(10,1,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/Message.owl#messageURI>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> message 1]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph
> 7]]]
> > 2014-07-30 14:07:59.023 Info:
> TriplePattern[order(9,4,7) PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> equipment 9]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://www.openrdf.org/schema/sesame#directType>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var
> equipmentType 4]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph
> 7]]]
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(9,6,7)
> PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var equipment
> 9]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/daf.owl#UUID>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var uniqueId 6]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]]
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(9,0,7)
> PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var equipment 9]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/stef.owl#name>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var name 0]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]]]
> > 2014-07-30 14:07:59.023 Info: SPARQLHashJoin[order(8,7)
> hash(7==7)
> > 2014-07-30 14:07:59.023 Info: SPARQLHashJoin[order(10,5,7)
> hash(7==7,10==10)
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(10,7) SOP
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/Message.owl#validMessage>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Literal "true"]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(10,5,7)
> PSO
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var Message 10]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/Message.owl#nodeId>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var nodeId 5]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]]
> > 2014-07-30 14:07:59.023 Info: TriplePattern[order(8,7) SOP
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var hvi 8]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[IRI <
> http://test/Agent.owl#Person>]
> > 2014-07-30 14:07:59.023 Info: GraphNode[Var graph 7]]]]]]]]
> >
> > Any help is appreciated,
> >
> > Thanks,
> >
> > Joel
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general