Hi list,

as always my question is about query performance.
The following very simple query performs very well on a V6.3rc1 with
default indexes:

select distinct
   ?r
   (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as
       ?_n_f_t_m_ex_
where {
   { ?r ?v1 ?v2 .
     ?v2 bif:contains 'lego' .
   }
   UNION
   { ?r ?v1 ?v3 .
     ?v3 ?v4 ?v2 .
     ?v4 rdfs:subPropertyOf rdfs:label .
     ?v2 bif:contains 'lego' .
   } .
} LIMIT 10

However, in Nepomuk we need to hide certain types from the user. To that
end we have the nao:userVisible property. Adding that to the query,
however, slows down the query considerably:


select distinct
   ?r
   (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as
       ?_n_f_t_m_ex_
where {
   { ?r ?v1 ?v2 .
     ?v2 bif:contains 'lego' .
   }
   UNION
   { ?r ?v1 ?v3 .
     ?v3 ?v4 ?v2 .
     ?v4 rdfs:subPropertyOf rdfs:label .
     ?v2 bif:contains 'lego' .
   } .
   ?r nao:userVisible "1"^^xsd:int .
} LIMIT 10

Suddenly a query which was done in no time takes up to several seconds.
This confuses me as I would think simply adding one condition on the
results should not make such a difference.

Any ideas?

Cheers,
Sebastian

Reply via email to