Hello everybody.
I built a SPARQL query using a nested subquery and noticed a huge
performance penalty. A simplified version of the query follows. Please note
that in the simplified query presented here I have only replaced URIs in
order to be more readable and left all the comparisons and conversions in
place as they could matter to the overall query performance.
SELECT ?a
FROM NAMED <b>
{
GRAPH <b>
{
?c d ?e .
BIND(REPLACE(STR(?e), "f", "", "i") AS ?g)
BIND(REPLACE(STR(?c), "f", "", "i") AS ?a)
FILTER (?g = STR(?h)) .
{
*SELECT ?h*
* FROM NAMED <i>*
* WHERE{*
* GRAPH <i>*
* {*
* ?j <k> ?h .*
* ?j <l> ?m .*
* FILTER (REGEX(STR(?m), "n", "i"))*
* }*
* }*
}
}
}
If I execute the above query as a nested query I get a response after 40
seconds. If I execute the nested query first (shown using bold characters)
and put the result in the filter of the outer query, I get the result in a
matter of 3 seconds (total). Given the simplicity of my rationale, I would
expect a similar logic and performance from virtuoso.
Have you noticed such a performance penalty before? Am I missing
something? Is there a more efficient way to build the above query? Could
the above query's performance penalty be caused due to a combination of the
usage of BIND, REPLACE, STR and nested queries in different graphs?
Please note that I am using Virtuoso Version: 07.20.3214, Build: Oct 14
2015 (I built it from source files).
Kind regards,
Pantelis Natsiavas
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users