Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The count query will trigger heavy looping #89

Closed
akkabin opened this issue Jun 17, 2015 · 6 comments
Closed

The count query will trigger heavy looping #89

akkabin opened this issue Jun 17, 2015 · 6 comments
Assignees

Comments

@akkabin
Copy link

akkabin commented Jun 17, 2015

The following count query will get the no endless looping.
SELECT (COUNT(*) as ?count) WHERE {?s ?p ?o .}

@agazzarini agazzarini added the bug label Jun 17, 2015
@agazzarini agazzarini self-assigned this Jun 17, 2015
@agazzarini
Copy link
Member

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.

  • Are you running SolRDF in standalone or Cloud mode
  • What is the size of the underlying dataset? In other words: what is the expected result of the query?

Thanks for entering this
Andrea


[1] org.gazzax.labs.solrdf.integration.sparql.LearningSparql_SELECT_ITCase.countFunction()

@agazzarini
Copy link
Member

@brianchen2012 please forget my questions: I just reproduced it

@agazzarini
Copy link
Member

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.

@akkabin
Copy link
Author

akkabin commented Jun 17, 2015

Yes, it will iterate through the result set

@akkabin akkabin changed the title No endless loop for the count query The count query will trigger heavy looping Jun 19, 2015
@agazzarini
Copy link
Member

@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

@agazzarini
Copy link
Member

Closed as it is not a bug, I opened the issue #96 for the general optimization topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants