Closed akkabin closed 9 years ago
Hi @brianchen2012 I have few questions, as the test suite already contains a test [1] that successfully executes the following query:
SELECT ?p (COUNT(?p) AS ?pTotal)
WHERE
{ ?s ?p ?o . }
GROUP BY ?p
which is very similar to your query.
Thanks for entering this Andrea
[1] org.gazzax.labs.solrdf.integration.sparql.LearningSparql_SELECT_ITCase.countFunction()
@brianchen2012 please forget my questions: I just reproduced it
A short update on this: that is not an endless loop. I know, it seems but it isn't.
The COUNT keyword evaluation triggers a scan across any entry in the target model defined by the WHERE condition (in the example on the whole dataset), so for instance if you have 1.000.000 of triples the query above does 1.000.000 of iterations...taking a lot of time...and this is the problem.
Yes, it will iterate through the result set
@brianchen2012 I'm still fighting with this issue, it seems that a deeper look into Jena internals is needed, so I think it will take me a bit
Closed as it is not a bug, I opened the issue #96 for the general optimization topic
The following count query will get the no endless looping. SELECT (COUNT(*) as ?count) WHERE {?s ?p ?o .}