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

Sebastian Schaffert commented on MARMOTTA-492:
----------------------------------------------

Hi Maxime,

by default the KiWi triple store does not itself optimize SPARQL queries and 
instead relies on the default Sesame approach, which computes the JOIN 
in-memory, and therefore, as you say, produces 60000 * 60000 results before 
filtering in-memory. However, KiWi comes with optional SPARQL-SQL translation 
which should give you optimized performance. To use it, you have to add the 
kiwi-sparql artifact to your classpath and wrap the KiWiStore in a 
KiWiSparqlSail as follows:

Sail store = new KiWiSparqlSail(new KiWiStore(conf));

Can you try this and tell us if it improves your performance?



> Issue With a SPARQL Query
> -------------------------
>
>                 Key: MARMOTTA-492
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-492
>             Project: Marmotta
>          Issue Type: Improvement
>          Components: KiWi Triple Store
>    Affects Versions: 3.2.0
>            Reporter: Maxime Poitevineau-Millin 
>            Assignee: Sebastian Schaffert
>              Labels: SPARQL, optimization, postgresql
>
> We are currently implementing marmotta in our system but!
> When trying this query :
> {code}
> SELECT * FROM <sesame:nil> {
>                                ?kw rdf:type Keyword . 
>                                ?kw2 rdf:type Keyword . 
>                                ?kw2 ?rel ?kw . 
> }
> {code}
> on a database containing 60 000 keywords, marmotta is creating 60 000 * 60 
> 000 queries similar to this one : 
> {code:sql}
> SELECT 
> id,subject,predicate,object,context,deleted,inferred,creator,createdAt,deletedAt
>  FROM triples WHERE deleted = false AND subject = '458172920399523841' AND 
> object = '458172732532453376' AND context = '458172711103754240'
> {code}
> Which obviously takes a long time.
> This query takes 2 sec on Virtuoso or Owlim, is there any configuration issue 
> or something we should change?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to