Hi there,

Showing the query would be helpful but some general remarks:

1/ If the query or the setup for Fuseki is needing more than the default heap size, then it might be that the Java JVM is getting into a state of heap exhaustion. This manifests as the CPU loading getting very high. It will seem like nothing is happening (waiting for response).

2/ The query may be expensive.

Things to look for
* cross products - two parts of the query pattern that are not
connected.

{ ?s ?p ?o . ?a ?b ?c } is N-squared the size of the database.

* sort, spilling to disk or combined with a cross product the query.

3/ If no results are coming back, then the query is form that does not stream back - sort, or CONSTRUCT maybe.

There was a useful presentation recently that talks about the principles of query efficiency.

SPARQL Query Optimization with Pavel Klinov
https://www.youtube.com/watch?v=16eMswT2x2Y

More inline:

On 06/05/2021 09:54, Martin Van Aken wrote:
Hi!
I'm Martin, I'm a software developer new to the Triples/SPARQL world. I'm
currently building queries against a Fuseki/TDB backend (that I can work on
too) and I'm getting into significant performance problems (including never
ending queries).

Are updates also happening at the same time?

Despite what I thought was a good search on the apache
jena website I could not find a lot of insight about performance
investigation so I'm trying it here.

Most of my data experience comes from the relational world (ex: PG) so I'm
sometimes drawing comparisons there.

To give some context my data set is around 15 linked concepts, with the
number of triples for each ranging from some hundreds to 500K - total less
than 2 millions (documents/authors/publication kind of data).

Unto questions:

    - When I'm facing a slow query, what are my investigation options. Is
    there an equivalent of an "explain plan" in SQL pointing to the query
    specific slow points? What's the advised way for performance checks in
    SPARQL?

qparse --print=opt --file query.rq

    - Are there any performance setups to be aware of on the server side?
    Like ways to check indexes are correctly built (outside of text search that
    I'm not working with for the moment)
    - We're currently using TDB1. I've seen the transactional benefits of
    TDB2 - are there performance improvements too that would warrant a
    migration there ?

Not on the query side.

    Andy


Thanks a lot already!

Martin

Reply via email to